linker command failed with exit code 1 (use -v to see invocation)
来源:互联网 发布:淘宝达人怎么发表状态 编辑:程序博客网 时间:2024/06/16 13:03
关于这个错误做个简单的笔记:
1.可能是库引用出问题,看具体的提示。会显示什么找不到
2.重复引用,比如我这次遇到的:(紫色部分才是我们要关心的)
duplicate symbol _XMPPHelperLoginOrRegister in:
/Users/wuwenhao/Library/Developer/Xcode/DerivedData/XMPP-giqpyyuvhqbwsshhmndjhkiffcqt/Build/Intermediates/XMPP.build/Debug-iphonesimulator/XMPP.build/Objects-normal/x86_64/WZLoginViewCotroller.o
/Users/wuwenhao/Library/Developer/Xcode/DerivedData/XMPP-giqpyyuvhqbwsshhmndjhkiffcqt/Build/Intermediates/XMPP.build/Debug-iphonesimulator/XMPP.build/Objects-normal/x86_64/AppDelegate.o
duplicate symbol _XMPPHelperLoginOrRegister in:
/Users/wuwenhao/Library/Developer/Xcode/DerivedData/XMPP-giqpyyuvhqbwsshhmndjhkiffcqt/Build/Intermediates/XMPP.build/Debug-iphonesimulator/XMPP.build/Objects-normal/x86_64/WZLoginViewCotroller.o
/Users/wuwenhao/Library/Developer/Xcode/DerivedData/XMPP-giqpyyuvhqbwsshhmndjhkiffcqt/Build/Intermediates/XMPP.build/Debug-iphonesimulator/XMPP.build/Objects-normal/x86_64/XMPPHelper.o
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
看上面的提示,就是重复了。那就去看看XMPPHelperLoginOrRegister这个类型。去工程里面搜索一下,看在哪里重复引用了,结果我只发现在XMPPHelper里面声明和调用了一个枚举,但是其它类引用了XMPPHelper这个类。再看看我的枚举声明:NS_ENUM(NSInteger , XMPPHelperLoginOrRegister) {
XMPPHelperLogin = 0,
XMPPHelperRegister,
};
问题来了,这个枚举并没有声明为一个类型,所以造成了引用问题。改成typdef NS_ENUM(NSInteger , XMPPHelperLoginOrRegister) {
XMPPHelperLogin = 0,
XMPPHelperRegister,
};就好了。
3.在网上有朋友说删除单元测试就可以了,这种情况我没遇到过,不过也可以做个备份。怎么删除单元测试:删除单元测试
4.还有网友说可能是Unity 5.1和Xcode的Build设定问题,这个我也没有遇到过,也做个备份:链接
不过具体的原因还是多看看错误提示,别看那个提示很长,但是大部分是文件的路径很长。所以简化一下也是很简单的。
小技巧:Xcode右下角那个{}图标的功能很好,值得关心。
- 错误1_clang: error: linker command failed with exit code 1 (use -v to see invocation)
- Exception for IOS 1-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) Undefined symbols for architecture
- 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)
- 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) 的方法
- 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)的错误调试
- 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)解决方法
- sizeof与strlen的区别:面试回答
- 镜面高光
- django进阶14 自定义manager
- Linux中常用操作命令
- Redhat下安装yum遇到的错误
- linker command failed with exit code 1 (use -v to see invocation)
- 自定义WordPress里标签(tag)和分类目录(category)的固定链接结构的方法
- Android最佳实践之:StrictMode介绍
- WEB访问绝对路径和cookie的设置
- SQL Server 中关于EXCEPT和INTERSECT的用法
- matlab图像陷波滤波以及低通滤波
- http报文格式
- 打包jar包到本地maven仓库
- iOS 打包ipa最简单粗暴的方式