[Error] #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.
时间: 2023-11-22 11:52:07 浏览: 185
这个错误信息意味着你的代码中使用了C++11标准的语法,但是编译器没有开启对C++11的支持。要解决这个问题,你需要在编译器的命令行中添加"-std=c++11"或者"-std=gnu++11"选项来开启对C++11的支持。
如果你使用的是IDE,可以在项目设置中找到编译器选项,然后添加上述选项。如果你使用的是命令行编译,可以在编译命令中添加上述选项。
例如,如果你使用g++编译器,可以这样编译:
```
g++ -std=c++11 your_file.cpp -o your_program
```
相关问题
:#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.
这个错误信息意味着您的代码中使用了 C++11 标准的功能,但是编译器没有开启对 C++11 标准的支持。您可以按照编译器提示的方法,在编译命令中添加 `-std=c++11` 或 `-std=gnu++11` 参数来开启对 C++11 标准的支持。例如:
```
g++ -std=c++11 main.cpp -o main
```
如果您使用的是其他编译器,也可以查看该编译器的文档,找到开启对 C++11 标准支持的方法。
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.
这个错误提示表示你的代码中使用了C++11标准的语法,但是编译器没有开启对C++11的支持。解决这个问题的方法是在编译命令中添加"-std=c++11"或"-std=gnu++11"选项,以开启C++11的支持。
例如,在使用g++编译器编译代码时,应该这样写:
```
g++ -std=c++11 your_file_name.cpp -o output_file_name
```
如果你使用的是其他编译器,可以查阅对应编译器的文档,了解如何开启C++11的支持。