链接器命令失败,退出代码 1、XCode 4.5、Facebook SDK 3.1
Posted
技术标签:
【中文标题】链接器命令失败,退出代码 1、XCode 4.5、Facebook SDK 3.1【英文标题】:Linker command failed with exit code 1, XCode 4.5, Facebook SDK 3.1 【发布时间】:2012-10-27 01:07:07 【问题描述】:我正在尝试将 Facebook SDK 集成到我的 xcode 项目中,但我遇到了一个绊脚石。
经过一些研究,我尝试确保我拥有最新版本的 FacebookSDK,因为那些与我有相同错误的人能够使用最新版本解决他们的问题,但这并没有帮助,所以我尝试下载来自github的源代码并使用build_all.sh命令重新编译,这也没有帮助。
我会把完整的错误日志放在最后,因为它超长,但这是最后的部分:
clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
我已经看到很多与此问题相关的字符串,但正如我之前所说,既没有更新到最新的 SDK(在我的情况下这是不必要的步骤,因为我已经有了它)或重新编译 armv7 的源代码,armv7s 修复了问题。
提前致谢,
汤姆
完整的错误日志:
重复的符号 _OBJC_IVAR__$_FBRequest._delegate 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_IVAR__$_FBRequest._url 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_IVAR_$_FBRequest._connection 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_IVAR_$_FBRequest._responseText 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_IVAR__$_FBRequest._error 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_IVAR_$_FBRequest._state 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_IVAR_$_FBRequest._sessionDidExpire 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_CLASS_$_FBRequest 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_METACLASS_$_FBRequest 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBRequest.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBRequest.o) 重复符号 _OBJC_IVAR_$_FBLoginDialog._loginDelegate 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBLoginDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBLoginDialog.o) 重复符号 _OBJC_CLASS_$_FBLoginDialog 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBLoginDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBLoginDialog.o) 重复符号 _OBJC_METACLASS_$_FBLoginDialog 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBLoginDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBLoginDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._orientation 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR__$_FBDialog._webView 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._modalBackgroundView 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity->iPhone.build/Objects-正常/armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._loadingURL 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._frictionlessSettings 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._delegate 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._showingKeyboard 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._closeButton 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._spinner 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._params 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._serverURL 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBDialog._isViewInvisible 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_CLASS_$_FBDialog 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_METACLASS_$_FBDialog 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBDialog.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBDialog.o) 重复符号 _OBJC_IVAR_$_FBFrictionlessRequestSettings._enabled 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBFrictionlessRequestSettings.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBFrictionlessRequestSettings.o) 重复符号 _OBJC_IVAR_$_FBFrictionlessRequestSettings._allowedRecipients 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBFrictionlessRequestSettings.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBFrictionlessRequestSettings.o) 重复符号 _OBJC_IVAR_$_FBFrictionlessRequestSettings._activeRequest 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBFrictionlessRequestSettings.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBFrictionlessRequestSettings.o) 重复符号 _OBJC_CLASS_$_FBFrictionlessRequestSettings 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBFrictionlessRequestSettings.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBFrictionlessRequestSettings.o) 重复符号 _OBJC_METACLASS_$_FBFrictionlessRequestSettings 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/FBFrictionlessRequestSettings.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(FBFrictionlessRequestSettings.o) 重复符号 _OBJC_IVAR_$_Facebook._requests 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_IVAR_$_Facebook._lastAccessTokenUpdate 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_IVAR_$_Facebook._frictionlessRequestSettings 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_IVAR_$_Facebook._fbDialog 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_IVAR_$_Facebook._appId 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_IVAR_$_Facebook._urlSchemeSuffix 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_IVAR_$_Facebook._isExtendingAccessToken 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_IVAR_$_Facebook._sessionDelegate 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_CLASS_$_Facebook 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) 重复符号 _OBJC_METACLASS_$_Facebook 在: /Users/tomhenry/Library/Developer/Xcode/DerivedData/Unity-iPhone-bioesylflkyylfdprjpcoipvoxpb/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal /armv7/Facebook.o /Users/tomhenry/Facebook/build/FacebookSDK.framework/FacebookSDK(Facebook.o) ld:架构 armv7 的 41 个重复符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
【问题讨论】:
你能解决这个问题吗? 在这里查看我的答案:***.com/questions/26656146/… 【参考方案1】:您缺少社交网络框架,请将其添加到目标中构建阶段二进制库的链接中。
【讨论】:
我从未听说过由于缺少另一个框架的链接而导致的错误“重复符号”。以上是关于链接器命令失败,退出代码 1、XCode 4.5、Facebook SDK 3.1的主要内容,如果未能解决你的问题,请参考以下文章
Xcode:Pod 安装后构建失败(错误:链接器命令失败,退出代码 1)
MAC OSX Xcode 9.2 链接器命令失败,退出代码为 1(使用 -v 查看调用)