链接器命令失败,退出代码为 1(使用 -v 查看调用)(armv7)xcode
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12671712/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
linker command failed with exit code 1 (use -v to see invocation) (armv7) xcode
提问by Dujard
I tried to compile my xcode project (i use xcode 4.5) and i have installed cordova 1,5 and the plugin BarecodeScanner on my project.
我试图编译我的 xcode 项目(我使用 xcode 4.5)并且我已经在我的项目中安装了cordova 1,5 和插件 BarecodeScanner。
When i try to compile on iOs 6 ipod devices, i have the following error :
当我尝试在 iOs 6 ipod 设备上编译时,出现以下错误:
Ld "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4" normal armv7s
cd /Users/username/Sites/iOS/codebarre4
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk "-L/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Products/Ad Hoc Distribution-iphoneos" "-F/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Products/Ad Hoc Distribution-iphoneos" -F/Users/Shared/Cordova/Frameworks -filelist "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4.LinkFileList" -dead_strip -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak_library /usr/lib/libSystem.B.dylib -fobjc-link-runtime -miphoneos-version-min=6.0 -weak-liconv -weak_framework CoreVideo -weak_framework AssetsLibrary -weak_framework AVFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework CoreLocation -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -framework CoreMedia -framework Cordova -o "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4"
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/Shared/Cordova/Frameworks/Cordova.framework/Cordova for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This error message is very complicated to understand... i searched on the web but found anything... Have you got any idea of the origin of this message ?
这个错误信息很难理解...我在网上搜索但发现了什么...你知道这个信息的来源吗?
Thanks a lot,
非常感谢,
回答by Daniel Tome
What worked for me, was to set "Enable Bitcode" to "No" in the Build Settings > Build options.
对我有用的是在“构建设置”>“构建选项”中将“启用位码”设置为“否”。
Use the search on the top: http://screencast.com/t/xSCnqHGkhh
使用顶部的搜索:http: //screencast.com/t/xSCnqHGkhh
The error I was getting was:
我得到的错误是:
XXX does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
XXX 不包含位码。您必须在启用位码的情况下重建它(Xcode 设置 ENABLE_BITCODE),从供应商处获取更新的库,或为此目标禁用位码。用于架构 arm64
回答by Sanjin Haracic
Your project may be configured to target armv7 which is hindering the linker.
您的项目可能被配置为以 armv7 为目标,这会阻碍链接器。
- Select your project
- Go to info tab
- Remove Required Device Capability item if existing (may be armv7 called)
- 选择您的项目
- 转到信息选项卡
- 删除必需的设备功能项(如果存在)(可能是 armv7 调用)
回答by jetfire
I was getting the same error as well.
我也遇到了同样的错误。
I resolved the issue on my end by using the following steps:
我通过使用以下步骤解决了这个问题:
- Going to the
Build Settingsfor the Project. - Under the
Settings>Valid Architecture settings, I had the values for Debug set toarmv7andarmv7s. And I had the values for Release set toarmv7andarmv7s. - I realized that the
armv7sitems were causing the problem. So I removedarmv7sfrom both entries.
- 前往
Build Settings项目。 - 在
Settings> 下Valid Architecture settings,我将 Debug 的值设置为armv7和armv7s。我将 Release 的值设置为armv7和armv7s。 - 我意识到是这些
armv7s项目导致了问题。所以我armv7s从两个条目中删除。
After that, I was able to archive my project with no issues.
在那之后,我能够毫无问题地存档我的项目。
回答by A_Thorne
You might not have included any framework in your project. Go to
您的项目中可能没有包含任何框架。去
Project > targets > build phases > link binary with libraries
项目 > 目标 > 构建阶段 > 将二进制文件与库链接
and add your missing framework.
并添加您缺少的框架。
回答by Jay Imerman
Also see this Question.
另请参阅此问题。
- Make sure your Build Settings "Architectures" setting includes the target architecture (the processor chip) - armv7 for iOS 6, armv7s for iOS 7, etc.
- If you have any third party libraries you link in, make sure they are built with the proper architecture support. Otherwise rebuild those libraries or check the developer for update downloads.
- Finally, reopen the project with updated libraries, Clean, and Build.
- You may also want to verify you have an up-to-date XCode with the right iOS supporting environments.
- 确保您的构建设置“架构”设置包括目标架构(处理器芯片) - 用于 iOS 6 的 armv7、用于 iOS 7 的 armv7s 等。
- 如果您链接了任何第三方库,请确保它们是使用适当的架构支持构建的。否则重建这些库或检查开发人员的更新下载。
- 最后,使用更新的库、清理和构建重新打开项目。
- 您可能还想验证您是否拥有具有正确 iOS 支持环境的最新 XCode。

