Compiling of C++ program with C++0x or C++11 support is simple by using of gcc compiler. C++0x or C++11 features are available in gcc compiler start from version 4.3 onward. If you are using gcc 4.3 onward, you may compile your C++ program with C++0x or C++11 support now.

Important: GCC’s support for C++11 is still experimental

Although you can compile with the new C++ standard support, not all features are available in one single gcc version. However, the greater version should have more features as compare to the old version.

Sample command to compile C++ with C++0x or C++11 support
To enable C++0x support, add the command-line parameter -std=c++0x to your g++ command line

g++ [source] -std=c++0x -o [output]


g++ hello.cpp -std=c++0x -o Hello

The command will compile hello.cpp file with C++0x enabled and produce an executable output called “Hello”

Command-line parameter -std=c++11 only available from gcc 4.7 onward.