XCode 6.1 Missing required architecture X86_64 in file for extern library

强颜欢笑 提交于 2019-12-10 05:10:39

问题


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 ?


回答1:


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.




回答2:


If a library doesn't have the X86_64 architecture you can build it if you've picked a connected device rather than a simulator for your build target.

Basically, you can still build and develop but you can't use the simulator.




回答3:


Click on your project > build setting > architecture. Change architecture as armv7 and delete others like armv6,etc, Then it will work :-




回答4:


In the project that builds libStimshop_SDK.a, be sure the "Architectures" setting is set to $(ARCHS_STANDARD) and that it includes 64-bit settings in the compiler settings. Be sure the "Valid Architectures" setting includes 64-bit as well.



来源:https://stackoverflow.com/questions/27185093/xcode-6-1-missing-required-architecture-x86-64-in-file-for-extern-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!