jarhead
jarhead

Reputation: 1901

Compiling with g++, using vector and array libraries

When compiling my cpp file on linux with the following line:

$ g++ -o blabla blabla.cpp

I get the following message on stdout:

In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/array:35,
from blabla.cpp:5: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../
    include/c++/4.4.7/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.

The script does #includes the <vector> and <array> libraries, so I don't know why it fails.

What causes this error?

Upvotes: 1

Views: 2271

Answers (1)

Shravan40
Shravan40

Reputation: 9908

Above error are coming because you are using the latest feature of C++, and you default version is older than required.

Flags (or compiler options) are nothing but ordinary command line arguments passed to the compiler executable.

g++ -std=c++0x -o blabla blabla.cpp

Upvotes: 3

Related Questions