iOS 中的链接器错误(体系结构 x86_64 的重复符号)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32514962/
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 Error in iOS (duplicate symbols for architecture x86_64)
提问by Dan
I keep on getting the following error:
我不断收到以下错误:
duplicate symbol _llvm.embedded.module in:
/Users/name/Documents/FacebookSDKs-iOS-20150910/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKApplicationDelegate.o)
/Users/name/Documents/FacebookSDKs-iOS-20150910/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKServerConfiguration.o)
ld: 102 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've tried deleting the FBSDK and reinstalling, but that has not work. I also suspect that the fact that I'm bridging the framework into Swift may be the problem. My bridging header contains the following:
我试过删除 FBSDK 并重新安装,但这不起作用。我还怀疑我将框架桥接到 Swift 的事实可能是问题所在。我的桥接头包含以下内容:
#ifndef EggCrush_Bridge_h
#define EggCrush_Bridge_h
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#endif
My AppDelegate.swift file imports FBSDKCoreKit.
There are no other linker flags.
I'm running Xcode 6.3.2 and building a project for iOS 8.3
我的 AppDelegate.swift 文件导入 FBSDKCoreKit。
没有其他链接器标志。
我正在运行 Xcode 6.3.2 并为 iOS 8.3 构建一个项目
How to clear this error up?
如何清除此错误?
回答by Guan Chuan
If not mistaken, you are using the sdk which just released by Facebook at September 10th, 2015 which named as FacebookSDKs-iOS-20150910.zip. Try to use sdk that released at August 13th, 2015 which named as FacebookSDKs-iOS-20150813.zipand report to Facebook about the duplication problem if you can. Thank you.
如果没记错的话,您使用的是 Facebook 于 2015 年 9 月 10 日刚刚发布的 SDK,名为FacebookSDKs-iOS-20150910.zip。尝试使用 2015 年 8 月 13 日发布的名为FacebookSDKs-iOS-20150813.zip 的sdk,如果可以,请向 Facebook 报告重复问题。谢谢你。
回答by Aravind Mariappan
This threadexplains you must compile the Facebook 4.6.0 SDK in Xcode 7 to resolve the issue. After compiling in Xcode 7 it worked for me.
此线程说明您必须在 Xcode 7 中编译 Facebook 4.6.0 SDK 才能解决此问题。在 Xcode 7 中编译后,它对我有用。
In the Facebook iOS SDK 4.6.0, App Thinning (Bitcode) support has been added and therefore it cannot be complied in Xcode versions lower than Xcode 7.0.
在 Facebook iOS SDK 4.6.0 中,添加了 App Thinning (Bitcode) 支持,因此无法在低于 Xcode 7.0 的 Xcode 版本中进行编译。
回答by Amy
When I had a duplicate symbols error, I opened my project.xcodeproj XML file in a text editor and searched the duplicate symbol. You'll most likely find that FacebookSDK shows up in multiple lines with the same "id" property. Make sure you have a back up of your current project, and try deleting the duplicates (ones that have the same id) manually in this file. Save the file, compile, and see if the project runs.
当我遇到重复符号错误时,我在文本编辑器中打开了 project.xcodeproj XML 文件并搜索了重复符号。您很可能会发现 FacebookSDK 出现在具有相同“id”属性的多行中。确保您有当前项目的备份,并尝试手动删除此文件中的重复项(具有相同 ID 的项)。保存文件,编译,看看项目是否运行。
You might want to try just deleting one duplicate line, and seeing if the number of duplicates (apparently you have 102!!) goes down first.
您可能只想尝试删除一个重复的行,然后查看重复的数量(显然您有 102 个!!)是否先下降。
回答by Sanandiya Vipul
- If you use FacebookSDKs-iOS-20160115.zipand your XCODE VersionXCODE 6.4or lower version of XCODEthen this type of issue create.
- FacebookSDKs-iOS-20160115.zipthis is use for XCODE 7.
- You can use https://developers.facebook.com/resources/FacebookSDKs-iOS-20150813.zip.
- Its work fine for you.
- 如果您使用FacebookSDKs-iOS-20160115.zip和您的 XCODE 版本XCODE 6.4或更低版本的XCODE,则会产生此类问题。
- FacebookSDKs-iOS-20160115.zip这是用于XCODE 7。
- 您可以使用https://developers.facebook.com/resources/FacebookSDKs-iOS-20150813.zip。
- 它对你来说很好。
回答by Aakash Wadhwa - iOS Developer
I faced the same issue of duplicate symbols. I was using Xcode 6.4but later when I upgraded to Xcode 7.0It Worked fine for me. I would suggest to Upgrade your Xcode to 7.0if you are using earlier one.
我遇到了相同的重复符号问题。我使用的是Xcode 6.4,但后来当我升级到Xcode 7.0 时,它对我来说很好用。如果您使用的是早期版本,我建议将您的Xcode升级到 7.0。