cmake编译出错:No CMAKE_CXX_COMPILER could be found.

简介: cmake编译出错:No CMAKE_CXX_COMPILER could be found.

错误类似:

-- The CXX compiler identification is unknown
-- The C compiler identification is GNU 8.3.0
CMake Error at CMakeLists.txt:99 (enable_language):
  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 install -y build-essential

目录
打赏
0
0
0
0
17
分享
相关文章
|
10月前
|
在VS2019中CMake生成出现报错
在VS2019中CMake生成出现报错
990 0
在VS2019中CMake生成出现报错
Cmake的使用
CMake的安装和使用,通过一个简单的项目示例,展示了如何编写CMakeLists.txt文件和main.cpp程序,以及如何通过CMake生成构建文件并编译项目。
102 0
CMake 围炉札记
CMake 围炉札记
92 12
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
2411 1
CMake中使用vcpkg
vcpkg是一个微软开源的C++包管理器。 在以前的开发中,如果在项目中需要使用某个开源库,例如qt,我们需要取官网下载qt的源码,然后构建得到对应的库,然后在项目中链接这个库。对于自己熟悉的库还好说,若是不熟悉的库,如何拉取源码?如何构建?如何在项目中引用?等等这些问题通常会困扰我们,然而,大多数情况下,我们只是使用这个开源库,并不需要关心这个库的构建和编译等问题。如此,在以前的开发过程中,往往会花费不少的时间在引入开源库上。 vcpkg是在背景下开发出来的,通过vcpkg,我们可以在项目中很方便的引入开源库,不用再关心拉取代码、构建开源库的这些事情。 CMake构建的项目中引入开源库
242 0
configure: The C compiler (located as /usr/bin/gcc) does not seem to be the required gcc compiler.
configure: The C compiler (located as /usr/bin/gcc) does not seem to be the required gcc compiler.
179 0
CMake教程4:最简单的CMake Library
CMake教程4:最简单的CMake Library
120 0
cmake编译出错:No CMAKE_CXX_COMPILER could be found.
cmake编译出错:No CMAKE_CXX_COMPILER could be found.
699 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等