在使用 make 編譯工程時可能會遇到:
#error 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.
我們需要找到當前編譯工程中的 CMakeList.txt
, 然後在裏面直接加入:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
重新編譯即可。