如何在 Xcode C++ 中更改编译器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32287584/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:44:22  来源:igfitidea点击:

How to change compiler in Xcode C++

c++xcodemacosptrace

提问by user1765804

I've been searching for quite some time, and I can't seem to find out how to change the compiler on the latest Xcode. I am not sure what it is set at currently, but I'd like to change it to GCC if possible. Right now my homework example will not recognize ptrace.h, so I think it might have to do with the chosen compiler.

我已经搜索了很长时间,但似乎无法找到如何在最新的 Xcode 上更改编译器。我不确定当前的设置,但如果可能,我想将其更改为 GCC。现在我的作业示例无法识别 ptrace.h,所以我认为这可能与所选的编译器有关。

回答by zaph

Screenshot of Build Rules:

构建规则截图:

enter image description here

在此处输入图片说明

You can add a rule for C++, click the "+" to the right of "Custom".

您可以为C++添加规则,单击“自定义”右侧的“+”。

回答by dangerousdave

Select the project in the browser, then navigate to...

在浏览器中选择项目,然后导航到...

XCode

代码