xcode “_OBJC_CLASS_$_Facebook”,引用自:AppDelegate.o 中的 objc-class-ref

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11886940/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:11:41  来源:igfitidea点击:

"_OBJC_CLASS_$_Facebook", referenced from: objc-class-ref in AppDelegate.o

iosxcodefacebook

提问by Bob Jones

I am getting this error when I build my project that involves posting to Facebook from an iPhone: Undefined symbols for architecture i386: "_OBJC_CLASS_$_Facebook", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

当我构建涉及从 iPhone 发布到 Facebook 的项目时出现此错误:架构 i386 的未定义符号:“_OBJC_CLASS_$_Facebook”,引用自:AppDelegate.o ld 中的 objc-class-ref:符号不为架构 i386 clang 找到:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

I've gotten errors like this before and it's always been because I have failed to import some package. But, I have already imported "FBConnect.h" and "Facebook.h", but maybe there's another one I'm missing. I also saw on a post on this site that you need to put the FBConnectSDK framework in "Link Binary With Libraries" under Build Settings, but I did that and I got 13 more errors... I am using storyboard and ARC is set to off. Thanks for your help.

我以前遇到过这样的错误,一直是因为我未能导入某些包。但是,我已经导入了“FBConnect.h”和“Facebook.h”,但也许我还缺少另一个。我还在本网站上的一篇文章中看到,您需要将 FBConnectSDK 框架放在“Build Settings 下的“Link Binary With Libraries”中,但我这样做了,我又遇到了 13 个错误……我正在使用故事板,ARC 设置为离开。谢谢你的帮助。

回答by edaype

I solve a similar problem by checking the Target Membership of my library. Select the library and files relevant to your app target from the Navigator. Check on the Utilities section that those files are marked as required for your app target.

我通过检查我的图书馆的目标会员来解决类似的问题。从导航器中选择与您的应用程序目标相关的库和文件。检查 Utilities 部分是否将这些文件标记为您的应用程序目标所需。