如何在 Windows 7 上的 CodeBlocks 中设置 C++11

How to set C++11 in CodeBlocks on Windows 7

本文关键字:CodeBlocks 设置 C++11 上的 Windows      更新时间:2023-10-16

我已经在Windows 7上安装了代码块。我无法选择 C++11 选项。我看了很多教程。在"全局编译器设置"中的每一个中,都有可供选择的选项(按顺序):

//have g++ follow the 1998 standard [...]
//have g++ follow the coming c++0x standard [...]
//have g++ follow the C++11 ISO standard [...]

在我的CodeBlocks版本中,缺少第三个选项。

只需转到:

Project => Build Options => Compiler Settings tab => Other Options and enter '-std=c++11'

或者,您可以转到:

Settings => Compilers => Select GNU GCC Compiler => Other Options => -std=c++11

如果这不起作用,请下载最新的GCC/MinGW编译器并转到:

Settings => Compilers => Select GNU GCC Compiler => Toolchain executables =>
Either AutoDetect or enter the path to the compiler folder =>
Save => Check again if the "g++ follow the C++11 ISO standard" is there