Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

C Question: What's wrong with my source code?

OpenStudy (anonymous):

Alright, I'm having problems with functions. Whenever I try to compile the source code, it returns this: Undefined symbols for architecture x86_64: "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status I removed the actual contents of the functions because they aren't the problem. #include <stdio.h> void MainMenu(); void ProcessChoice(); void ProcessMenuReturn(); void ExchangeRates(); char Choice, MenuReturn; float Rates[7] = { 43.90 , // USD 59.50 , // EUR 34.12 , // SGD 0.58 , // JPY 67.94 , // GBP 45.24 , // AUD 43.07 }; // CAD void MainMenu() { //some code here } void ProcessChoice() { //some code here } void ProcessMenuReturn() { //some code here } void ExchangeRates() { // some code here }

OpenStudy (anonymous):

is there a main() function anywhere in your program?

OpenStudy (anonymous):

I don't see one. There is no entry point to the code.

OpenStudy (anonymous):

first of all as mentioned, you are missing the main() function, which is the entry to your program, this is needed in C/C++, but there exists other languages which does not require main function, like python (the whole file it self becomes the main when it is executed)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!