【解决】CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM

dulucy | 2025-10-17 16:46:19 | Linux
 【解决】CMake Error: CMake was unable to find a build program corresponding to

在使用vscode连接子系统Ubuntu 进行c++项目编译,报错:

CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):   The C++ compiler     "/usr/bin/c++"   is not able to compile a simple test program.
 CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.

在找了很多博文,最终发现执行

sudo apt-get install make

可以解决。

博主原因是:经过资料查阅,出现该问题的原因是 : 【当前系统未安装 make】,这个原因可能是本人在安装 cmake 时候直接下载的编译版本,未进行原生编译造成的,

参考博文:【解决】CMake was unable to find a build program corresponding to “Unix Makefiles“.-CSDN博客

相关标签: Linux