Saleh
Saleh

Reputation: 380

Project doesn't build for iphone simulator.

I get this error while trying to build for iphone simulator:

    d: warning: ignoring file /users/salehshah/SmartSwipe/libANMobilePaymentLib.a, file was    built for archive which is not the architecture being linked (i386) Undefined symbols for architecture i386:

Please note that i am using xcode 4.2 with iOS 5. Project builds and runs fine on device. I think there is some problem while linking the static library. May be it is problem with the architectures.

Upvotes: 0

Views: 569

Answers (1)

tonklon
tonklon

Reputation: 6767

The static library you are linking is not compiled for the simulator. If this is a precompiled library you would want to create a version, that includes all three iOS architectures armv6 armv7 and i386. You can do so by compiling every single architecture on their own and then linking them together using lipo see man lipo

If on the other hand you are compiling the library as a dependency of your app target, something is wrong with your build settings. Have a look a the libraries build settings, namely the ARCHS and the VALID_ARCHS

Upvotes: 2

Related Questions