clang:错误:不能同时指定“-fobjc-arc"和“-fobjc-gc" [英] clang: error: cannot specify both '-fobjc-arc' and '-fobjc-gc'

查看:68
本文介绍了clang:错误:不能同时指定“-fobjc-arc"和“-fobjc-gc"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实将 Objective-C 自动引用计数设置为 YES,但我有Objective-C 垃圾收集设置为不支持

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

所以我不知道如何设置 -fobjc-gc.是否还有其他我没有注意到的设置?我尝试了一个干净的构建,所以它不会留下任何东西.

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.

推荐答案

我间接找到了答案,感谢 这个问题.事实证明,为了摆脱垃圾收集,当我点击项目下的构建设置和目标下的时候,我需要在编译器设置中关闭垃圾收集.如果他们不同意,目标(这是我没有注意到的)覆盖.再多的项目级别的设置也无法解决这个问题.

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.

这篇关于clang:错误:不能同时指定“-fobjc-arc"和“-fobjc-gc"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆