clang: error: cannot specify both '-fobjc-arc' and '-fobjc-gc'

久未见 提交于 2019-12-07 11:02:25

问题


I do have Objective-C Automatic Reference Counting set to YES, but I have Objective-C Garbage Collection set to Unsupported

So I don't see how -fobjc-gc could be getting set. Is there something else that also sets it that I haven't noticed? I've tried a clean build, so it's not something sticking around.


回答1:


I found the answer, indirectly, thanks to this question. It turns out, that to get rid of garbage collection, I need to BOTH turn off garbage collection in the compiler settings when I click on Build Settings under the Project, and under the Target. If they disagree, the target (which is the one I didn't notice) overrides. No amount of playing with the settings at the project level was fixing that.



来源:https://stackoverflow.com/questions/10239116/clang-error-cannot-specify-both-fobjc-arc-and-fobjc-gc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!