为什么找不到 CMAKE_CXX_COMPILER。如何解决?

ale*_*lec 8 make cmake

在尝试在新的 Kubuntu 安装上构建https://gitlab.com/interception/linux/tools时,cmake ..tools/build目录运行会返回错误:

CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
Run Code Online (Sandbox Code Playgroud)

我刚刚安装cmake并假设它会配备它的编译器,但也许它需要配置才能使用?

ale*_*lec 21

“编译器”是一个需要安装的单独包。一个调用g++可以单独安装,也包含在一个名为“build-essential”的包中。

因此sudo apt-get install build-essential解决了问题(并且sudo apt-get install g++应该也可以),允许cmake ..在不需要配置的情况下工作。