How to fix Undefined characters for i386 architecture: "_main" binding problem?

I am trying to use KeyChainitemwrapper provided by apple. My project uses ARC, but I turned ARC into KeyChainitemwrapper.m. I linked the "security.framework" framework with my project.

I get this communication problem:

Undefined characters for i386 architecture: referring to "_main": start with crt1.10.6.o ld: character not found for i386 architecture clang: error: linker command did not work with exit code 1 (use -v to call the call)

I'm new to ios, but I assume the problem is that the simulator is trying to compile the original targeting of i386, not arm? I'm close?

Anyway .. it seems like this wrapper is pretty popular, so I was wondering if anyone who might be familiar with this issue could reach out.

thanks

+6
source share
3 answers

This means that you are not compiling main.m into your project. Verify the following:

  • You have main.m in your project
  • It has a function called main()
  • In fact, you are compiling it. Go to your project, then “Form Phases”, then “Compile Sources”. Make sure main.m is listed.
+24
source

your code will be compiled for the i386 architecture when using the simulator. If you use a real device, your code will be compiled by hand.

i downloaded this project, the main.c file is inside the "other sources" group.

0
source

Removing links to main.ce in your project solves this problem for me

0
source

Source: https://habr.com/ru/post/907132/


All Articles