简体   繁体   English

如何在NetBeans IDE的编译器选项中添加-std = c ++ 11?

[英]how do I add -std=c++11 to the compiler options in my NetBeans IDE?

Netbeans give me the following error: Netbeans给我以下错误:

"error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. “错误此文件需要ISO C ++ 2011标准的编译器和库支持。此支持当前处于试验性,必须使用-std = c ++ 11或-std = gnu ++ 11编译器选项启用。

Im not sure how to fix this. 我不知道如何解决这个问题。 any help? 任何帮助?

First: Open project properties and then Code Assistance->C++ Compiler. 首先:打开项目属性,然后打开代码协助-> C ++编译器。 In C++ Standard select C++11. 在C ++ Standard中,选择C ++ 11。

Second: you must enable C++11 in your project. 第二:必须在项目中启用C ++ 11。 If you created the c++ project from inside Netbeans, in project properties->Build->C++ Compiler, you must set C++ standard to C++11, and then click on dots in Additional Options and ensure that the -std=c++11 option is enabled. 如果从Netbeans内部创建了c ++项目,在项目属性 - > Build-> C ++ Compiler中,必须将C ++标准设置为C ++ 11,然后单击Additional Options中的点并确保-std = c ++ 11选项已启用。

If you imported the project with external makefile, you must add manually this option in the makefile. 如果使用外部makefile导入了项目,则必须在makefile中手动添加此选项。

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

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