Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I correct the "Undefined symbols for architecture i386: "_main" linking issue?

I am trying to use the KeyChainitemwrapper provided by apple. My project is using ARC but I have turned of ARC on KeyChainitemwrapper.m. I linked the 'security.framework' framework to my project.

I am getting this linking issue:

Undefined symbols for architecture i386: "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am new to ios development but my guess is that the problem has to do with the fact that the simulator is trying to compile my source targeting i386 rather than arm?? Am I close?

Anyways.. it appears that this wrapper is fairly popular so I was wondering if someone who might be familiar with this problem could lend a hand.

Thanks

like image 726
Nick Avatar asked Jan 29 '12 00:01

Nick


1 Answers

This suggests that you're not compiling main.m in your project. Make sure of the following:

  • You have a main.m in your project
  • It has a function in it called main()
  • You're actually compiling it. Go to your project, then Build Phases, then Compile Sources. Make sure main.m is in the list.
like image 62
Rob Napier Avatar answered Sep 30 '22 17:09

Rob Napier