一、报错信息
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: 错误:#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.
#error This file requires compiler and library support for the \
二、报错原因
c++ 使用11互斥锁mutex
#include <mutex>
cmake 使用c++11标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
三、问题分析
问题原因是cmake 3.0版本以上才支持c++11标准
升级cmake即可解决这个问题
四、升级cmake到3.29
cd cmake-3.29.3
./configure
make & make install
如果有如下报错
CMake Error at Utilities/cmcurl/CMakeLists.txt:644 (message): Could not find OpenSSL. Install an OpenSSL development package or configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL
缺少openssl-devel库,安装继续
sudo yum install openssl-devel