----
The flag should be -std=c++11 |
----
The flag -std=c++11 is not available in % man gcc:
-std=
*c90
*c89
*iso9899:1990
Support all ISO C90 programs (certain GNU extensions that conflict with ISO C90 are disabled). Same as -ansi for C code.
*iso9899:199409
ISO C90 as modified in amendment 1.
*c99
*c9x
*iso9899:1999
*iso9899:199x
ISO C99. Note that this standard is not yet fully supported; see <
http://gcc.gnu.org/gcc-4.6/c99status.html> for more
information. The names c9x and iso9899:199x are deprecated.
*c1x ISO C1X, the draft of the next revision of the ISO C standard. Support is limited and experimental and features enabled by
this option may be changed or removed if changed in or removed from the standard draft.
*gnu90
*gnu89
GNU dialect of ISO C90 (including some C99 features). This is the default for C code.
*gnu99
*gnu9x
*gnu++98
GNU dialect of -std=c++98. This is the default for C++ code.
*c++0x
The working draft of the upcoming ISO C++0x standard. This option enables experimental features that are likely to be
included in C++0x. The working draft is constantly changing, and any feature that is enabled by this flag may be removed from
future versions of GCC if it is not part of the C++0x standard.
*gnu++0x
GNU dialect of -std=c++0x. This option enables experimental features that may be removed in future versions of GCC.
----
show your compile command |
:----
% g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/testExercise1.d" -MT"src/testExercise1.d" -o "src/testExercise1.o" "../src/testExercise1.cpp"
----Here the full log in Eclipse:----
>make all
>Building file: ../src/testExercise1.cpp
>Invoking: Cross G++ Compiler
>g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/testExercise1.d" -MT"src/testExercise1.d" -o >"src/testExercise1.o" "../src/testExercise1.cpp"
>In file included from /usr/include/c++/4.6/chrono:35:0,
> from ../src/testExercise1.cpp:10:
>/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.
>../src/testExercise1.cpp: En la función ‘int main()’:
>../src/testExercise1.cpp:15:23: error: ‘chrono’ no es un nombre-de-espacio-de-nombres
>../src/testExercise1.cpp:15:29: error: expected namespace-name before ‘;’ token
>make: *** [src/testExercise1.o] Error 1