1、安装cmake sudo apt-get install cmake
2、安装之后查看是否安装成功: cmake --version
3、出现 No CMAKE_C_COMPILER could be found.如何解决
使用cmake命令时发现,cmake --version获取版本成功了
但是编译却找不到。
cmake ..
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:21 (project):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:21 (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.
解决办法:
执行
sudo apt-get update
sudo apt-get install -y build-essential