当使用make进行编译时,有以下错误
This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
解决办法
-
在主工程的目录下CMakeLists.txt中添加命令行如下:
set(CMAKE_CXX_FLAGS "-std=c++11 -O3")
-
若是在ubuntu中使用g++编译的话 将g++ 直接换成下面的编译语句
g++ -std=c++11 文件名.cpp -o main