添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误
来源:互联网 发布:教育部网络教育 编辑:程序博客网 时间:2024/06/14 20:51
linker command failed with exit code 1 (use -v to see invocation)这个错误貌似遇见并不止一次,当我想用某个第三方类库的时候(如SBJson),我直接把类库文件copy到工程目录里面,然后一编译就出现这样错误(并不是一定会出这样错误),开始以为是网上下载的类库本身问题,所以重新找类库或者其他方式将它添加进去,只要不出错就行,也一直没有深入了解根本问题,今天在给工程添加一个FMDB(SQLIte第三方类库)文件编译时又出现这种错误,一开始以为工程问题,但是新建工程后还是出现这个问题,经过网上查找,得到了解决办法;
- Undefined symbols for architecture i386:
- "_OBJC_CLASS_$_FMDatabase", referenced from:
- objc-class-ref in ViewController.o
- ld: symbol(s) not found for architecture i386
- 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/
0 0
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误
- 51单片机的时钟及总线时序和总线扩展
- mysql事务处理
- Hbase shell 常用命令
- spring 笔记1
- SMTP:防止追踪发件人IP
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误
- Mac环境下svn的使用
- ajax表单提交上传文件(异步上传与文本编辑器)
- Implement strStr()
- Xcode 6制作动态及静态Framework
- SQLSERVER中如何快速比较两张表的不一样
- printf 和scanf 的使用范围
- mac上安装MySQL
- JAVA学习笔记(三十一)- 对象序列化Serializable