添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
来源:互联网 发布:java 对象赋值 编辑:程序博客网 时间:2024/06/06 00:16
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.old: symbol(s) not found for architecture i386clang: 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)的错误调试
- linux下启动oracle
- c++ 中__declspec 的用法
- Linux常用命令小结
- Java 虚拟机限制
- KGmodal的基本用法
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 我为什么要写博客?
- 指针数组和数组指针分别是如何指向二维数组的
- How to sort an array of hashes into hashes with multiple values for a key?
- Scala的List
- log4j配置祥解
- APUE学习笔记(19)-守护进程
- 一个Web页面的问题分析
- strcpy溢出的攻击示例