Xcode static library reference error when building for iPhone device

I am using xcode 4.6. The SDK is iOS 6.1. The error I received is "Undefined symbols for armv7 architecture" whereas the project links my own generated static library called libEncrypt.a.

I'm pretty sure I created libEncrpt.a using the armv7 architecture. Using "otool -a" to test the static library, it displays below message. Don't understand why the xcode threshold is complaining about an error like "Undefined for armv7 architecture" ??

> otool  -a libEncrypt.a 
Archive : libEncrypt.a (architecture armv7)
0100644 505/20    108 1360127518 #1/20
0100644 505/20   3604 1360127513 #1/20
Archive : libEncrypt.a (architecture armv7s)
0100644 505/20    108 1360127518 #1/20
0100644 505/20   3604 1360127513 #1/20

      

Add a verbosity error message:

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

      

+3


source to share


1 answer


Double check the Embedded Active Architecture Only settings in the Application and Static Library projects.



I had the same problem because I only had "Build Active Architecture Only" for YES for my static library, but not for my iOS app. When the iOS app tried to create the Debug assembly, all architectures were expected to exist, but for the static library only armv7s are generated because I was deploying my iPhone 5.

+2


source







All Articles