错误 Build Settings,No Common Blocks

Build Settings,No Common Blocks
今天在项目里拖进了一个第三方SDK的源码,项目编译时fail,错误信息是duplicate symbols for architecture arm64。百度半天无果,通过使用古老的一一对比的查找方法中发现一处不同,直觉告诉我需要修改Build Settings里的No Common BlocksNONo Common Blocks的Quick Help信息如下:

GCC_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. [GCC_NO_COMMON_BLOCKS, -fno-common]

原来是在这个SDK里有的头文件声明了公共变量,然后在另外几个文件里import了这个头文件,No Common Blocks默认为YES,编译器就报错了。

如果这篇文章对您有些许帮助 请给我点个心哦。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容