简体   繁体   English

如何在 Xcode 8 下用 C++11 编译项目?

[英]How to compile a project with C++11 under Xcode 8?

This question was asked many times and I failed to replicate all of the solutions I could find.这个问题被问了很多次,我未能复制我能找到的所有解决方案。 I am unable to find this setting under File->Project Settings (as some suggested).我无法在文件-> 项目设置下找到此设置(如某些人所建议的)。 Please be very specific.请非常具体。 If you know an answer for Xcode 7, chances are it will work for me too.如果您知道 Xcode 7 的答案,那么它很可能也适用于我。

It's the same for 7 and 8. From the Project Navigator, select the project. 7 和 8 相同。从 Project Navigator 中,选择项目。 In the main panel, at the top left, select the target.在主面板的左上角,选择目标。 Now the main panel should have General, Resource Tags, Build Settings, Build Phases, & Build Rules along the top.现在主面板顶部应该有常规、资源标签、构建设置、构建阶段和构建规则。 Select Build Settings, select All.选择构建设置,选择全部。 Scroll down to "Apple LLVM 8.0 Language C++" and expand it.向下滚动到“Apple LLVM 8.0 Language C++”并展开它。 Change "C++ Language Dialect" to "C++11 [-std=c++11]".将“C++ 语言方言”更改为“C++11 [-std=c++11]”。

构建设置 -> 链接 -> 其他链接器标志 -> 添加到“-lc++”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM