error This file requires compiler and library support for the ISO C++ 2011 standard.

来源:互联网 发布:汽车编程 编辑:程序博客网 时间:2024/05/16 02:09

error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

当使用CMAKE编译工程时,出现这个错误,解决办法:
在工程主目录的CMakeLists.txt中添加如下,可以编译成功:

SET( CMAKE_CXX_FLAGS "-std=c++11 -O3")
1 0
原创粉丝点击