连接常见错误linker command failed with exit code 1 (use -v to see invocation)
来源:互联网 发布:电脑功率测试软件 编辑:程序博客网 时间:2024/05/20 07:34
连接常见错误linker command failed with exit code 1 (use -v to see invocation)
这种问题,通常出现在添加第三方库文件或者多人开发时。
这种问题一般是找不到文件而导致的链接错误。 我们可以从如下几个方面着手排查。
1.以如下错误为例,如果是多人开发,你同步完成后发现出现如下的错误。
- Undefined symbols for architecture armv7:
- "_OBJC_CLASS_$_MyPageLogViewController", referenced from:
- objc-class-ref in BaiduMobStatAppDelegate.o
- ld: symbol(s) not found for architecture armv7
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
错误中出现了“MyPageLogViewController”这个类,你可以找到这个类的.m文件, 查看他的Target Membeship, 如下图
如果没有勾选上,点击勾选。然后编译查看。
2. 如果是新添加的第三方库,且不是静态库
先重复第一步过程,然后找到 Build settings->Linking->Other Linker Flags
将此属性修改成-all_load 或者 -ObjC ,这个视情况而定。总之可以多试几次。
3.如果添加的是第三方静态库(.a文件)
- Undefined symbols for architecture armv7:
- "_OBJC_CLASS_$_BaiduMobStat", referenced from:
- objc-class-ref in BaiduMobStatAppDelegate.o
- objc-class-ref in MyPageLogViewController.o
- (maybe you meant: _OBJC_CLASS_$_BaiduMobStatAppDelegate)
- ld: symbol(s) not found for architecture armv7
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
在用到这个库的所有文件中都出现了错误, 如上 BaiduMobStatAppDelegate 类和 MyPageLogViewController类
这种情况就可能是这个静态库路径混乱导致的链接错误
解决方法:Build settings->Search Path->Library Search Paths 添加静态库的相应路径。如下图
如果上面的所有方法都不管用。你可以再试试一下几个方法:
1,看看是不是有新添加的文件跟之前文件同名
2,错误信息中出现了某个类的名字,去原文件中看看#import了哪些第三方库,把这些库挨个注释排除,找到出错的那个库,然后按照官方提供的步骤重新添加一遍。
0 0
- 连接常见错误linker command failed with exit code 1 (use -v to see invocation)
- iOS常见错误之 linker command failed with exit code 1(use -v to see invocation)
- 错误1_clang: error: 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)的错误调试
- iOS linker command failed with exit code 1 (use -v to see invocation)错误
- error: linker command failed with exit code 1 (use -v to see invocation 错误处理
- 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)
- iOS:编译错误 linker command failed with exit code 1 (use -v to see invocation)
- error: linker command failed with exit code 1 (use -v to see invocation)错误解决方法
- iOS调试错误 linker command failed with exit code 1 (use -v to see invocation)
- clang: error: linker command failed with exit code 1 (use -v to see invocation)错误问题
- 错误 clang: error: linker command failed with exit code 1 (use -v to see invocation)
- 关于linker command failed with exit code 1 (use -v to see invocation)错误
- IOS-59-解决错误:linker command failed with exit code 1 (use -v to see invocation)
- 错误: error linker command failed with exit code 1 (use –v to see invocation)
- Linux系统查看系统是32位还是64位方法总结
- LR_关联
- 从0到1思考与实现iOS-Widget
- ubuntu 13.04 安装 JDK
- 如何正确的ignore git中的文件
- 连接常见错误linker command failed with exit code 1 (use -v to see invocation)
- UVA1584Circular Sequence
- 【bzoj 1051】[HAOI2006]受欢迎的牛
- oralce分组去重查询
- React-native 常见错误:Seems you're trying to access 'ReactNative.Component' from the 'react-native'
- LabVIEW的for循环事例
- CNN感性认识(二)——神经网络的优化
- ubuntu 安装svn
- ArrayBlockingQueue与LinkedBlockingQueue的使用及区别