Xcode7升级到Xcode8之后遇到文件冲突
2015-09-20 18:38
866 查看
UP主今天升级了XCode到8之后,打开了工程就崩溃了。。。,看错误代码
凌乱的我就在网上开始找问题,后来看到一种可能,是因为这个文件中的某一变量或者某一方法名和其他某一文件的变量名或者方法有重复同名,就找到了解决方法:
在Build Setting里面 NO Common Blocks 设置为NO,就解决问题了,那么“NO Common Blocks”是什么呢?
官方的解释是:
In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without extern ) in two different compilations, you will get an error when you link them. The only reason this might be useful is if you wish to verify that the program will work on other systems which always work this way.
在C语言中,在目标文件的数据段分配甚至未初始化的全局变量,而不是生成它们作为公共块。这样做,如果同一个变量被声明(没有extern)放在两个不同的汇编,你会当你将它们链接得到一个错误的影响。这可能是有用的唯一原因是,如果你想验证程序将在其他系统上,它总是以这种方式工作工作。(原谅我英语不好)。
duplicate symbol _myBlock in: /Users/****/Library/Developer/Xcode/DerivedData/****-gixcunlvzgbiameffodyrjucpldm/Build/Intermediates/****.build/Debug-iphoneos/****.build/Objects-normal/arm64/PCCircleInfoView.o /Users/****/Library/Developer/Xcode/DerivedData/****-gixcunlvzgbiameffodyrjucpldm/Build/Intermediates/****.build/Debug-iphoneos/****.build/Objects-normal/arm64/ShareApp.o duplicate symbol _myBlock in: /Users/****/Library/Developer/Xcode/DerivedData/****-gixcunlvzgbiameffodyrjucpldm/Build/Intermediates/****.build/Debug-iphoneos/****.build/Objects-normal/arm64/PCCircleInfoView.o /Users/****/Library/Developer/Xcode/DerivedData/****-gixcunlvzgbiameffodyrjucpldm/Build/Intermediates/****.build/Debug-iphoneos/****.build/Objects-normal/arm64/ModifyAddrModelControl.o 。。。。。。。。中间省略好多行 ld: 247 duplicate symbols for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ????247个错误分析了一下,是PCCircleInfoView这个文件引入重复,和其他247个文件有冲突,但是神奇的是。Complie Souces 引入了248个文件,也就是我这个文件和所有文件有冲突。
凌乱的我就在网上开始找问题,后来看到一种可能,是因为这个文件中的某一变量或者某一方法名和其他某一文件的变量名或者方法有重复同名,就找到了解决方法:
在Build Setting里面 NO Common Blocks 设置为NO,就解决问题了,那么“NO Common Blocks”是什么呢?
官方的解释是:
In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without extern ) in two different compilations, you will get an error when you link them. The only reason this might be useful is if you wish to verify that the program will work on other systems which always work this way.
在C语言中,在目标文件的数据段分配甚至未初始化的全局变量,而不是生成它们作为公共块。这样做,如果同一个变量被声明(没有extern)放在两个不同的汇编,你会当你将它们链接得到一个错误的影响。这可能是有用的唯一原因是,如果你想验证程序将在其他系统上,它总是以这种方式工作工作。(原谅我英语不好)。
相关文章推荐
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 不可修补的 iOS 漏洞可能导致 iPhone 4s 到 iPhone X 永久越狱
- iOS 12.4 系统遭黑客破解,漏洞危及数百万用户
- 每日安全资讯:NSO,一家专业入侵 iPhone 的神秘公司
- [转][源代码]Comex公布JailbreakMe 3.0源代码
- js判断客户端是iOS还是Android等移动终端的方法
- IOS开发环境windows化攻略
- .net平台推送ios消息的实现方法
- 探讨Android与iOS,我们将何去何从?
- Android、iOS和Windows Phone中的推送技术详解
- IOS 改变键盘颜色代码
- 举例详解iOS开发过程中的沙盒机制与文件
- Android和IOS的浏览器中检测是否安装某个客户端的方法
- javascript实现阻止iOS APP中的链接打开Safari浏览器
- IOS开发第三方语音-微信语音
- iOS开发之路--微博OAuth授权_取得用户授权的accessToken
- 基于UIControl控件实现ios点赞功能
- iOS开发中实现邮件和短信发送的简单示例