CMake Error at build/_deps/glog-src/CMakeLists.txt:1 (cmake_minimum_required):
这个错误提示意思是你当前系统上安装的 CMake 版本过低,不满足项目的要求。根据错误信息:
CMake Error at build/_deps/glog-src/CMakeLists.txt:1 (cmake_minimum_required): CMake 3.22 or higher is required. You are running version 3.16.3
-
项目要求: CMake 版本必须是 3.22 或更高。
-
你当前版本: 你正在使用 CMake 3.16.3,低于项目要求。
解决方法
1.卸载旧版本 CMake
sudo apt remove cmake
2.下载脚本
wget https://cmake.org/files/v4.0/cmake-4.0.1-linux-x86_64.sh
3.给安装脚本添加执行权限
chmod +x cmake-4.0.1-linux-x86_64.sh
sudo ./cmake-4.0.1-linux-x86_64.sh