可能会遇到这几种错误:
Undefined symbols for architecture armv7
Undefined symbols for architecture armv7s
Undefined symbols for architecture arm64
Undefined symbols for architecture i386
Undefined symbols for architecture x86_64

错误原因分析
1、大部分情况下是忘记添加了某个系统framework或dylib吧,比如你在项目中使用了sqlite3,但是没有添加libsqlite3.dylib,就会出现这个问题。解决办法是增加对应的framework或dylib。
2、如果是在C++里调用C函数,检查是否有添加extern "C",这可以通过观察错误提示中的函数名形式来决定,如果是C函数而以C++的方式调用就需要添加extern "C"。
3、
如果是把其它工程的xcodeproj文件加入到当前项目中,检查Build Phases中的Target
Dependencies有没有添加依赖,以及General中的Linked Frameworks and
Libraries有没有添加相关的.a文件。
4、如果添加.a文件编译无错而添加xcodeproj文件编译出错可参考3
5、如果添
加.a文件编译出错,首先检查其对应的头文件是否添加正确,或者在Build Setting中有没有添加对应的Header Search
Path路径;其次检查.a文件的c++编译选项与当前项目的c++编译选项是否一致;最后检查.a文件与当前项目的CPU架构信息是否一致
6、如果是extern变量报这个错误,要检查extern变量有没有在其它地方声明,如果没有则加上;如果外部变量在静态库中,可根据5检查引用头文件或头文件搜索路径是否正确;如果头文件无问题,就需要检查静态库与与当前项目的CPU架构信息是否一致
7、
如果是使用了静态库,真机Debug测试时正常,而在执行for iOS
Device测试时报这个错误,很可能是因为静态库支持的架构不全。出现这种情况是Build Setting中的Build Active
Architecture Only在Debug下设为Yes,从而使得真机Debug测试正常。

检查静态库的CPU架构支持命令:
lipo -info xxxxx.a

找出不支持arm64的静态库
find . -name *.a -exec lipo -info "{}" \;

在@end处提示expected }错误解决

题很明显是}匹配出现问题了。如果代码少很好找,如果代码很多怎么缩小查找范围呢?一般出现这个问题时伴随另一个错误:在某个函数定义处提示"Use
of undeclared identifire
'someMethod'”,那么就是在此函数定义之前的地方少了一个},导致编译器误把函数定义当成函数调用了。

Xcode编译Undefined symbols for architecture xxx 错误总结的更多相关文章

  1. Undefined symbols for architecture armv7错误解决方法

    Undefined symbols for architecture armv7: "_OBJC_CLASS_$_BriefMainModel", referenced from: ...

  2. ios build时,Undefined symbols for architecture xxx问题的总结

    简单来说,Undefined symbols基本上等于JAVA的ClassNotFoundException,最常见的原因有这几种: build的时候没有加framework 比如说,有一段代码我用了 ...

  3. Undefined symbols for architecture xxx

    解决方法: "Build Settings"->"Linking"->"Other Linker Flags" add the ...

  4. 用xcode6.3编译早期工程时出现Undefined symbols for architecture x86_64错误的解决办法(转)

    Xcode升级到5.1 新特性之一就是默认让所有App都通过64位编译器编译.原来在Xcode5.0.x的时候默认的Standard architectures只有(arm7,armv7s),到5.1 ...

  5. ios开发错误之: Undefined symbols for architecture x86_64

    错误如下: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RoutingHTTPServer", refere ...

  6. iOS出现 Undefined symbols for architecture armv7 std::basic_string<char, std::char_traits<char>

    Undefined symbols for architecture i386: “_OBJC_CLASS_$_XXX”, referenced from: objc-class-ref in XXX ...

  7. 静态库引入引起的错误解决方案,ld: warning: ignoring file ”…/XXX.a”, file was built for archive which is not the architecture being linked (armv7): “…/XXX.a” Undefined symbols for architecture armv7: "_OBJC_CLASS_$

    想目中不免会引入一些静态库,可是有时加入'.a'文件后编译便会报以下错误 ld: warning: ignoring file ”…/XXX.a”, file was built for archiv ...

  8. 添加第三方类库造成的Undefined symbols for architecture i386:编译错误

    1.原因: 如果是源码编译的话,一般就只某些头文件没有添加到src编译里面.但是对于添加库编译,一般是库的编译路径设置不正确(比如arm的版本.模拟器或者真机的不同版本库引用错误或者重复引用一起编译器 ...

  9. iOS:编译错误Undefined symbols for architecture i386: _OBJC_CLASS_$_XXX&quot;, referenced from: error

    Undefined symbols for architecture i386: _OBJC_CLASS_$_XXX", referenced from: error 这个意思为无法找到名为 ...

随机推荐

  1. CSS外边距合并(塌陷/margin越界)

    原文 简书原文:https://www.jianshu.com/p/5f18f12cd162 大纲 1.什么是外边距合并?(折叠外边距) 2.外边距带来的影响 3.折叠的结果 4.产生折叠的原因 5. ...

  2. Tomcat redis 配置

    http://www.cnblogs.com/interdrp/p/4868740.html http://blog.csdn.net/qq584852076/article/details/4650 ...

  3. 每日技术总结:setx,

    1.setx命令设置环境变量 设置用户环境变量: setx NAME "XXX" 设置系统环境变量: setx NAME "XXX" /m

  4. UVA 11800 - Determine the Shape 几何

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  5. [React Intl] Get locale value from intl injector

    Get 'injectIntl' from  'react-intl', it is a high order componet. We need to wrap our component into ...

  6. POJ 1753 Flip Game DFS枚举

    看题传送门:http://poj.org/problem?id=1753 DFS枚举的应用. 基本上是参考大神的.... 学习学习.. #include<cstdio> #include& ...

  7. UVA 11136 - Hoax or what (可以提交了,不会Submission error了)

    看题传送门:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...

  8. Android应用性能优化系列视图篇——隐藏在资源图片中的内存杀手

    图片加载性能优化永远是Android领域中一个无法绕过的话题,经过数年的发展,涌现了很多成熟的图片加载开源库,比如Fresco.Picasso.UIL等等,使得图片加载不再是一个头疼的问题,并且大幅降 ...

  9. SpringCloud微服务学习笔记

    SpringCloud微服务学习笔记 项目地址: https://github.com/taoweidong/Micro-service-learning 单体架构(Monolithic架构) Mon ...

  10. [AngularFire2] Update multi collections at the same time with FirebaseRef

    At some point, you might need to udpate multi collections and those collections should all updated s ...