c ++ 0x_warning.h:31:2:错误:

时间:2012-10-06 17:34:58

标签: ubuntu g++

我正在尝试制作文件并收到此错误。我是新手。有人能帮我一下吗。

/usr/include/c++/4.6/bits/c++0x_warning.h:32:2: error: #error This
file requires compiler and library support for the upcoming ISO C++
standard, C++0x. This support is currently experimental, and must be
enabled with the -std=c++0x or -std=gnu++0x compiler options.

如何使用-std=c++0x启用? 我在makefile #CXX_VERSION_FLAG = -std=c++0x中使用了这个,但没有用。

谢谢, 阿迪

2 个答案:

答案 0 :(得分:2)

不,只需将这些标志(也就是选项)传递给编译器。不要运行gcc ...,而是为新编译器运行gcc -std=c++0x ...(或-std=c++11。)

答案 1 :(得分:0)

Makefiles中以'#'开头的行是注释行。 尝试删除“#”。