As others have suggested, you need to enter the std commandline option. Let us make it easy for you
- Open terminal by pressing Ctrl+Alt+T
sudo gedit ~/.bashrc
Enter the following line as the last line
alias g++="g++ --std=c++0x"
- Save and close the file and close the terminal.
- Now open terminal again and compile your c++ 11 programs simply by
g++ filename.cpp
Thats it. By default it will compile for c++11 standard.
NOTE: If you follow the above mentioned option, to compile non-c++ 11 programs, you have to use
g++ --std=c++98 filename.cpp
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…