添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
来源:互联网 发布:淘宝买东西 编辑:程序博客网 时间:2024/06/05 22:02
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)的错误调试
- C# Datatable的使用方法
- 第六周 项目2 对象作为数据成员
- windows+android+cocos2d-x环境配置
- 新浪微博demo设计大概思路和方法
- ie6 兼容 fixed
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 轻松打造品牌轻应用:实时Web App开发框架Clouda
- linux 隔行打印或隔行删除
- Androidpn 服务端重启时客户端自动重连
- 此的逼真,可现实世界很
- php基础之final
- Android数据的四种存储方式SharedPreferences、SQLite、Content Provider和File (二) —— SQLite
- 获取手机设备号
- linux i2c驱动架构(史下最全) davinc dm368 i2c驱动分析