简体   繁体   English

Xcode 5.1针对C ++ 98进行编译,避免使用C ++ 11功能

[英]Xcode 5.1 compile against C++98, avoid C++11 features

I'm currently working on a project that primarily uses C++98 as a coding standard for backwards compatibility. 我目前正在一个项目中,该项目主要使用C ++ 98作为向后兼容的编码标准。 I'm working on OSX10.9 mavericks and have compiled all dependencies against libc++ . 我正在研究OSX10.9特立独行者,并针对libc++编译了所有依赖项。 I would like to configure Xcode in such a way that it gives me a warning or doesn't compile when I use C++11 language features. 我想以这样的方式配置Xcode,当我使用C ++ 11语言功能时,它会发出警告或无法编译。

Compiling with the -std=c++98 flag didn't show any errors/notifications concerning the use of C++11 features. 使用-std=c++98标志进行编译时,未显示有关使用C ++ 11功能的任何错误/通知。

I didn't enable the "Using C++11 extensions in earlier versions of C++"-warning. 我没有启用“在早期版本的C ++中使用C ++ 11扩展”警告。 Now XCode will show me a compiler warning if I use C++11 features. 现在,如果我使用C ++ 11功能,XCode将向我显示一个编译器警告。

To check if I use library features from the new standard I still have to link libstdc++ . 要检查是否使用新标准中的库功能,我仍然必须链接libstdc++

该屏幕快照显示了XCode中的“在早期版本的C ++中使用C ++ 11扩展”。

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

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