xcode 架构 i386 的未定义符号“_OBJC_CLASS_$_Appirater”

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

Undefined symbols for architecture i386 "_OBJC_CLASS_$_Appirater"

objective-cxcodecompiler-errors

提问by CristiC

After adding Appirater to my iOS project, when I compile, I get the error:

将 Appirater 添加到我的 iOS 项目后,编译时出现错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Appirater", 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)

After searching and searching on the internet, none of the solutions found helped.

在互联网上搜索和搜索后,找到的解决方案都没有帮助。

Both my project and target are setup as:

我的项目和目标都设置为:

enter image description here

在此处输入图片说明

What should I try more?

我应该多尝试什么?

回答by Tomasz Wojtkowiak

I think, that you only added files to project, but not to target.
Click on Appirater.mfile in Project Navigatorand set checkbox near to your target name in Target membershipof File Inspector.

我认为,您只将文件添加到项目,而不是目标。
点击Appirater.m文件Project Navigator和设置复选框接近你的目标名称Target membershipFile Inspector

回答by Codo

It seems that you haven't properly added the Appirater code to your project. Both Appirater.hand Appirater.mmust be part of your project, and Appirater.mmust be compiled like all your other files.

您似乎没有将 Appirater 代码正确添加到您的项目中。双方Appirater.hAppirater.m一定是你的项目的一部分,Appirater.m必须像所有其他文件进行编译。

回答by Greg

You'll also get this error if you've neglected to add the CFNetwork and SystemConfiguration frameworks to your project.

如果您忽略了将 CFNetwork 和 SystemConfiguration 框架添加到您的项目,您也会收到此错误。

回答by Patrick

I just had the same problem, and fixed it.

我刚刚遇到了同样的问题,并修复了它。

The cause of my issue is I had dragged and dropped a file from other project to the current.

我的问题的原因是我将文件从其他项目拖放到当前项目中。

Of course it is working when we remove and recreate the file.

当然,当我们删除并重新创建文件时,它是有效的。