If you’ve tried compiling something like std::to_string(42) and received a compiler error then chances are your Eclipse CDT isn’t set up for C++ 11. No worries. Everything you need is already installed, all you need to do is enter the proper project settings.
To start you need to add the “-std=c++0x” flag to your make file. To do this in Eclipse, right-click on your project and select Properties. Next go to C/C++ Build -> Settings and under the Tool Settings tab select Miscellaneous. In the Other flags textbox enter the parameter as shown below.
Almost done. Now from the same properties window go to the C/C++ General section and select Paths and Symbols. Select the Symbols tab and under Languages pick GNU C++. Click the Add button.
In the Add Symbol window enter
__GXX_EXPERIMENTAL_CXX0X__ as the Name of the symbol. Keep the the value blank. Click Okay and Apply.
You will be asked to rebuild the catalogue. Just click yes. You should now be able to compile C++ 11 code under Eclipse.