转自 :http://www.reader8.cn/jiaocheng/20131022/2003334.html

Undefined symbols for architecture http://www.reader8.cn/jiaocheng/20131022/2003334.html:
"_utf8_nextCharSafeBody", referenced from:
-[SRWebSocket _innerPumpScanner] in AVOSCloud(SRWebSocket.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我是用pod添加的avos,之前使用过多次avos都没出现过问题,这次莫名奇妙出现了这个问题,不知道少引了什么。。。

这是因为从 2.5.9 开始,AVOSCloud 增加了实时通信的功能, 会依赖 libicucore.dylib 。

linker command failed with exit code 1 (use -v to see invocation)的错误调试情况1、linker command fai

 

linker command failed with exit code 1 (use -v to see invocation)的错误调试
情况1、

linker command failed with exit code 1 (use -v to see invocation)这个错误貌似遇见并不止一次,当我想用某个第三方类库的时候(如SBJson),我直接把类库文件copy到工程目录里面,然后一编译就出现这样错误(并不是一定会出这样错误),开始以为是网上下载的类库本身问题,所以重新找类库或者其他方式将它添加进去,只要不出错就行,也一直没有深入了解根本问题,今天在给工程添加一个FMDB(SQLIte第三方类库)文件编译时又出现这种错误,一开始以为工程问题,但是新建工程后还是出现这个问题,经过网上查找,得到了解决办法;

[cpp] view plaincopy

  1. Undefined symbols for architecture i386:
  2. "_OBJC_CLASS_$_FMDatabase", referenced from:
  3. objc-class-ref in ViewController.o
  4. ld: symbol(s) not found for architecture i386
  5. clang: error: linker command failed with exit code 1 (use -v to see invocation)

在网上得到解决办法是:

在工作左边导航栏Target-->Build Phases-->compile Sources中,第三库库的所有.m文件都添加到里面,然后编译通过了;

添加.m文件

根据对比可以看见 in FMDBTest,FMDBTest的Target里添加进去了了一些.m文件

对于以上错误,根据网友解答我的理解是

我们在使用这些第三方类库文件时直接将其拖拽到工程之中,编译的的时候Xcode也没有自动引用,所以造成这样错误,这就需要我们手动添加。假如我们在工程中新建某个文件就不会出现这样问题;

参考  http://blog.hsin.tw/2012/ios-dev-undefined-symbols-for-architecture-i386/

情况2、

linker command failed with exit code 1 (use -v to see invocation)

出现这种情况很可能是,项目中引入了多个相同的文件。删除一个就ok!
情况3、

xcoder的一个编译错误:

linker command failed with exit code 1 (use -v to see invocation)

说明有无法准确找到的函数,函数有重复现象。

造成这个错误的原因是我直接在 .h头文件中实现了几个函数,然后这个头文件又被别的.c文件所引用,有实现的。

所以解决办法是把实现的几个函数单出一个.c文件里去。这样就ok了。

情况4、

把 Valid Architectures  的值改为 armv7

过程:

PROJECT --> Build Settings --> Architectures --> Valid Architectures  他的值本来是 armv7 armv7s  (ios6.0下)  把armv7s 去掉即可

同样的操作

TARGETS -->  Build Settings --> Architectures --> Valid Architectures  做同样的修改

情况5、 很奇葩的情况啊,就是引用第三方的静态库.a 出现了问题. 在模拟器和真机引入的静态库是分开的!!!当然如果你的静态库做成了统一的,那就不会出现情况5.

linker command failed with exit code 1 (use -v to see的更多相关文章

  1. symbol(s) not found for architecture x86_64 之 linker command failed with exit code 1 (use -v to see invocation)解决方案排查

    这样的错误 ,我的解决方案是, 第一种:   查看他说在 ****.o 中,你要查看这样的关键点,然后去查看,你 项目中有没有引进这样的文件,在项目中查找,看项目中有没有,如果没有那就是没添加进来,你 ...

  2. linker command failed with exit code 1 (use -v to see invocation)

    背景:用U盘从另一台电脑考过来后,出现错误 linker command failed with exit code 1 (use -v to see invocation) 出现这种情况很可能是,项 ...

  3. linker command failed with exit code 1 (use -v to see invocation)解决办法

    [cpp] view plaincopy Undefined symbols for architecture i386:     "_OBJC_CLASS_$_FMDatabase&quo ...

  4. clang: error: linker command failed with exit code 1 (use -v to see invocation)

    报错提示: ... ld: 6 duplicate symbols for architecture x86_64 clang: error: linker command failed with e ...

  5. IOS Bugs5 linker command failed with exit code 1 (use -v to see invocation)

    Ld /Users/Rubert/Library/Developer/Xcode/DerivedData/OC_Language-emftyzftyvhdpuaxipddjmpnpvox/Build/ ...

  6. [Bug-IOS] - linker command failed with exit code 1 (use -v to see invocation)

    Ld /Users/Rubert/Library/Developer/Xcode/DerivedData/OC_Language-emftyzftyvhdpuaxipddjmpnpvox/Build/ ...

  7. (转) error: linker command failed with exit code 1 (use -v to see invocation)

    转自:http://blog.csdn.net/tiantian1980/article/details/9175777   像这样的一大堆,总体说编译链接时错误 /Users/zhangtianji ...

  8. 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试

    linker command failed with exit code 1 (use -v to see invocation)这个错误貌似遇见并不止一次,当我想用某个第三方类库的时候(如SBJso ...

  9. linker command failed with exit code 1 (use -v to see invocation),经典Xcode编译错误的出现和解决!

    linker command failed with exit code 1 (use -v to see invocation)这个肯定是个xcode编译运行的时候经典的报错了. 这个问题曾经在我的 ...

  10. 使用SVN clang: error: linker command failed with exit code 1 (use -v to see invocation)

    然后上传到该项目SVN仓库上,例如,下面的错误再次发生再拉到本地编译 ld: library not found for -lxxxxxxxxxxxx clang: error: linker com ...

随机推荐

  1. 深入了解css3新特性

    深入了解css3新特性:http://www.ibm.com/developerworks/cn/web/1202_zhouxiang_css3/

  2. [转]8 Regular Expressions You Should Know

    Regular expressions are a language of their own. When you learn a new programming language, they're ...

  3. 面试题-Java基础-异常部分

    1.Java中的两种异常类型是什么?他们有什么区别? Java中有两种异常:受检查的(checked)异常和不受检查的(unchecked)异常.不受检查的异常不需要在方法或者是构造函数上声明,就算方 ...

  4. As input tri-stated

    前些日子正好看到了riple兄的<一波三折--危险的"未分配"引脚>一文,颇受启发.正好最近也遇上了类似的问题,也可谓一波三折,还好最后摆平了,要不煮熟的鸭子可就要飞了 ...

  5. 手动安装VS code 插件

    现在安装包: 通过修改下面的地址参数:https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publish ...

  6. 父子页面(iframe)相互获取对方dom元素

    现在iframe的使用虽然开始越来越少,但是还是有牵涉到iframe的使用情况,特别是多个iframe互相嵌套,又要进行获取的情况. 现在整理了父子iframe之间互相获取的方式. (1)父页面获取子 ...

  7. 返回变量的类型VarType函数

    'vbEmpty 0 Empty(未初始化)'vbNull 1 Null(无有效数据)'vbInteger 2 整数'vbLong 3 长整数'vbSingle 4 单精度浮点数'vbDouble 5 ...

  8. Managed Switch: Confs

    shortcuts: c-w: delete word before c-a: move to first char c-y: delete everything after cursor c-z: ...

  9. FileZilla客户端源码解析

    FileZilla客户端源码解析 FTP是TCP/IP协议组的协议,有指令通路和数据通路两条通道.一般来说,FTP标准命令TCP端口号是21,Port方式数据传输端口是20. FileZilla作为p ...

  10. cuckoo相关

    Q1:pefile is out of date 现象:ERROR: Your version of pefile is out of date.  Please update to the late ...