Xcode iOS开发BUG记录:Undefined symbols for architecture i386 / duplicate symbol _OBJC_CLASS_

来源:互联网 发布:东北大学软件学院教师 编辑:程序博客网 时间:2024/05/22 10:53

错误日志:
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
      objc-class-ref in UIDevice+IdentifierAddition.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)


错误原因及解决方法:
1、缺少framework;
解决办法:检查Project Setting - target - Build  Phases - link binary with libraries,尤其是在使用第三方类库时, 检查是否缺少某个framework
2、.m文件引用错误
解决办法:检查Project Setting - target - Build  Phases - compile sources,是否缺少.m文件



错误日志:

ld: duplicate symbol _OBJC_CLASS_$_************ in ****************


错误原因及解决方法:
1、包含重复类
解决办法:检查项目里是否包含相同的类。一般来说in前后的两个路径为冲突的路径,注意检查两个路径中的文件
注意:
(1)在引用第三方类库时,如果引用的两个类库中包含相同的类,如同时引用了JSONKit、ASIHTTPRequest等开源库,需要删掉其中一个
(2)如果引用的类库中同时包含已编译好的.a文件和未编译某个文件,也会报错,需要删除相同的类
2、Xcode引用错误(You could also get this error if you mistakenly let XCode's auto-complete for #import statements specify the '.m" file for the 'duplicate' class instead of the '.h'.xcode的自动完成特性,在你导入头文件的时候,将".h"补成了".m"

解决办法:重新单独添加相应的.m文件


0 0
原创粉丝点击