Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode 6.1 Missing required architecture X86_64 in file for extern library

I have an issue when trying to use an external lib : I can't compile the project as it throws an exception as below.

ld: warning: ignoring file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a, missing required architecture x86_64 in file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a (3 slices) Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_StimshopSDK", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)`

I tried lots of solutions found on stackoverflow (but for XCode 5.1 and not as well explained) without any change ...

I also found this topic XCode 6.1 Missing required architecture X86_64 in file that exactly correspond to my problem and when looking at my lib's architecture with lipo -info command, it seems it's missing i386 and x86_64. How could I add them to my library architectures to be able compile ?

like image 380
Renaud Cousin Avatar asked Nov 28 '14 09:11

Renaud Cousin


1 Answers

This means your .a library doesn't contain the x86_64 architecture (You can run lipo -info /path/to/your/lib.a to verify it). If you don't have the source code of the library, you have to modify your own project. In the build settings, change the valid architectures to armv7 and i386, or change Architectures to armv7 only. However, by doing so, your project won't be compiled to the arm64 architecture, which is required when uploading to the App Store after Feb 2015, according to Apple's announcement.

If your library doesn't contain x86_64 architecture, it is likely that it doesn't contain arm64 either. So you should avoid using old libraries.

like image 83
Henry H Miao Avatar answered Oct 31 '22 10:10

Henry H Miao