gcc要求使用-std = c ++ 11,即使我已经在使用它

时间:2017-05-05 08:36:38

标签: c++ c++11 gcc compiler-errors compilation

我正在尝试编译this页面中提供的代码。这是我正在使用的gcc命令:

$HOME/gcc-6.3.0/bin/g++ -std=c++11 -Wall -ansi -g -Wno-deprecated -I./util -finline-limit=100000 -c -o type.o type.cpp

我收到以下错误和警告:

In file included from ~/gcc-6.3.0/include/c++/6.3.0/cstdint:35:0,
                 from cluster.h:6,
                 from type.h:7,
                 from type.cpp:1:
~/gcc-6.3.0/include/c++/6.3.0/bits/c++0x_warning.h:32:2: erreur : #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^~~~~
In file included from type.cpp:2:0:
relation.h: Dans la fonction membre « int Relation::getState(const CombNode* const&, const CombNode* const&, const int&, const bool&) »:
relation.h:1172:7: attention : this « if » clause does not guard... [-Wmisleading-indentation]
       if (cmp < 0)  return STATE_N0_BEFORE_N1;
       ^~
relation.h:1173:21: note : ...this statement, but the latter is misleadingly indented as if it is guarded by the « if »
                     return STATE_N0_AFTER_N1;
                     ^~~~~~
relation.h:1178:7: attention : this « if » clause does not guard... [-Wmisleading-indentation]
       if (cmp < 0)  return STATE_N0_AFTER_N1;
       ^~
relation.h:1179:21: note : ...this statement, but the latter is misleadingly indented as if it is guarded by the « if »
                     return STATE_N0_BEFORE_N1;
                     ^~~~~~
makefile:26 : la recette pour la cible « type.o » a échouée
make: *** [type.o] Erreur 1

我不明白的是我使用选项-std = c ++ 11,但我仍然得到#34;这个文件需要编译器和库支持ISO C ++ 2011标准&#34; 。我按照错误消息的建议尝试了-std = gnu ++ 11,但这并没有改变gcc输出。

0 个答案:

没有答案