简体   繁体   English

仅设备上的链接器错误

[英]Linker error on device only

Im getting the follwoing error when compiling for my device 我在为我的设备编译时收到以下错误

File is universal (3 slices) but does not contain a(n) armv7s slice: /Users/xxx/Desktop/xxxxxxx/DropboxSDK.framework/DropboxSDK for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ive checked all .m files are linked and all ok, why is it only doing this on device and what does the compiler want to stop it complaining? 我已经检查了所有.m文件是否都已链接并且一切正常,为什么只在设备上执行此操作,编译器又想阻止它抱怨什么?

"armv7s" is the instruction set supported by the new ARM processor in the iPhone 5. Xcode 4.5 by default generates binaries for armv7 and armv7s. “ armv7s”是iPhone 5中新的ARM处理器支持的指令集。默认情况下,Xcode 4.5会为armv7和armv7s生成二进制文件。

The linker error means that your app is compiled for armv7 and armv7s (and i386 for the Simulator), but is linked to the DropboxSDK framework which does not contain armv7s code. 链接器错误意味着您的应用程序针对armv7和armv7s(对于Simulator为i386)进行了编译,但已链接至不包含armv7s代码的DropboxSDK框架。

So you have the following options: 因此,您有以下选择:

  • Download and install the latest DropboxSDK framework. 下载并安装最新的DropboxSDK框架。 According to the CHANGELOG , iPhone 5 support has been added. 根据CHANGELOG的说明 ,已添加了对iPhone 5的支持。
  • Compile your app for "armv7" only. 仅针对“ armv7”编译您的应用。 This is configured in the "Architectures" of the "Build Settings" of your target. 这是在目标的“构建设置”的“架构”中配置的。

You said that "No lib that refers to Dropbox". 您说“没有库引用Dropbox”。 But there must be some reference to that library, otherwise the linker would not complain. 但是必须对该库有一些引用,否则链接器不会抱怨。 You can check that in the "Link Binary with Libraries" section of the "Build Phases" tab of your target settings. 您可以在目标设置的“构建阶段”选项卡的“将二进制文件与库链接”部分中进行检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM