Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static iOS Library builds for device but not Simulator

Getting this error, though the library is in the Link with Binary Libraries area and the header file is included as well.

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_TestLibraryEric", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I get this error when I build for simulator, but not for the device. I've seen this question the opposite way, where it builds for simulator but not for device. Build for active architecture only is set at NO Any ideas?

like image 828
Eric Avatar asked Apr 17 '12 14:04

Eric


1 Answers

The error means that the TestLibraryEric is only built for devices (compiled for ARM architectures), and not for the simulator (i386 architecture).

If the library is one you have created, you need to change the build settings.

In the Supported Platforms field, you should have iphoneos.

Add iphonesimulator, and your library will be built both for devices and simulator.

Do a clean, rebuild the library and it should do the trick.

like image 65
Mutix Avatar answered Oct 11 '22 18:10

Mutix