编译器需要c ++ 0x但标志已经添加到命令中

时间:2017-01-18 00:05:13

标签: c++11 compilation g++

编译器的版本是4.4.6,它应该支持c ++ 0x,如下所示:https://gcc.gnu.org/gcc-4.4/cxx0x_status.html

但我仍然遇到编译错误:

        id1     name    id2   val 
0       1        'A'     1     2.0
1       1        'B'     1     0.5
2       2        'C'     3     0.25
. 
.
.

该标志已添加到makefile中,如下所示:

*In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cinttypes:35,
...
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/c++0x_warning.h:31: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.*

我尝试了g++ **-std=c++0x** $(LDFLAGS) $(Objs) -o Test 但是没有工作。

1 个答案:

答案 0 :(得分:0)

您已将选项添加到 link 命令,而不是 compile 命令。您需要将其添加到CXXFLAGS。