To enable C++0x support, add the command-line parameter -std=c++0x
to your g++
command line. Or, to enable GNU extensions in addition to C++0x extensions, add -std=gnu++0x
to your g++
command line. GCC 4.7 and later support -std=c++11
and -std=gnu++11
as well.
比如我要编译一个pro_display.cpp
如果是VC平台,vs2012,vs2013默认应该支持。
#g++ pro_dispaly.cpp -std=c++11 #也可以指定输出文件名,通过-o参数
来自:http://gcc.gnu.org/projects/cxx0x.html