Trying to compile a iPhone/iPad application with SDK3.2 and am getting this error:
Undefined symbols:
"_main", referenced from:
Start in crt1.10.5.o
Symbol(s) not found
Collect2: Id returned 1 exit status
I think it's telling me that it's somehow trying to work with code from another SDK but searching the web has not provided any clear answers.
Anyone able to guide me on this and what to look for?
It looks like you haven't provided a main
function in any of your source files. The crt
object file is most likely the startup code which sets up your environment then calls main
(CRT usually stands for C runtime, when it's not being used to mean Cathode Ray Tube, which it shouldn't any more, that being dead technology and all).
The Undefined symbols: "_main" ...
simply means that the linker has discovered crt1.10.5.o
needs the _main
symbol satisfied and none of the files provided are satisfying it.
Short of seeing the actual linker command line, we can't be certain what's being included. You should check your source code and confirm or deny the existence of main()
? And that it's inluded in the build?
There appears to be several possible causes.
I ran into this problem when the Perform Single-Object Prelink build option was checked (GENERATE_MASTER_OBJECT_FILE = YES).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With