XCode 6.1 缺少外部库文件中所需的架构 X86_64 [英] XCode 6.1 Missing required architecture X86_64 in file for extern library

查看:31
本文介绍了XCode 6.1 缺少外部库文件中所需的架构 X86_64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试使用外部库时遇到问题:我无法编译该项目,因为它会引发如下异常.

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:警告:忽略文件/Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a,缺少文件/Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimShopPOC/libStimShopPOC 中所需的架构 x86_64.a(3片)体系结构 x86_64 的未定义符号:_OBJC_CLASS_$_StimshopSDK",引用自:ViewController.o 中的 objc-class-refld:找不到架构 x86_64 的符号clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)`

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)`

我尝试了很多在 stackoverflow 上找到的解决方案(但对于 XCode 5.1 并没有很好的解释)没有任何改变......

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

我也发现了这个话题 XCode 6.1 缺少与我的问题完全对应的文件 中所需的架构 X86_64 并且使用 lipo -info 命令查看我的 lib 架构时,似乎缺少 i386x86_64.我怎样才能将它们添加到我的库架构中以便能够编译?

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 ?

推荐答案

这意味着您的 .a 库不包含 x86_64 架构(您可以运行 lipo -info/path/to/your/lib.a 来验证).如果您没有库的源代码,则必须修改自己的项目.在构建设置中,将 valid architectures 更改为 armv7i386,或将 Architectures 更改为 armv7 仅.但是,根据 Apple 的公告,这样做后,您的项目将不会被编译为 arm64 架构,这是 2015 年 2 月之后上传到 App Store 时所必需的.

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.

如果您的库不包含 x86_64 架构,则很可能也不包含 arm64.所以你应该避免使用旧的库.

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.

这篇关于XCode 6.1 缺少外部库文件中所需的架构 X86_64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆