views:

437

answers:

1

Hi all,

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?

+2  A: 

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. Can you post your source and confirm or deny the existence of main()? And that it's inluded in the build?

paxdiablo
Doh! I was thinking I had a main function being included when it wasn't. Thanks. So obvious :-)
Derek Clarkson