【发布时间】:2017-10-03 15:47:17
【问题描述】:
我正在尝试编译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,但我仍然得到“此文件需要 ISO C++ 2011 标准的编译器和库支持”。我按照错误消息的建议尝试了 -std=gnu++11 但这并没有改变 gcc 输出。
【问题讨论】:
标签: c++ c++11 gcc compiler-errors compilation