Error de CMake en CMakeLists.txt: No se pudo encontrar CMAKE_CXX_COMPILER.

系统环境:
OS:Ubuntu 22.04.1

1. Ocurre un problema

Este problema le pasó al autor al instalar YouCompleteMeel complemento , pero hay muchos amigos en Internet que también tienen este problema por otras razones.

imaginemiracle:YouCompleteMe$ python3 ./install.py 
Searching Python 3.10 libraries...
#######library_dirs############
['/usr/lib/python3.10/config-3.10-x86_64-linux-gnu', '/usr/lib64', '/usr/lib']
#######library_dirs############
......
......
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:26 (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.


-- Configuring incomplete, errors occurred!
See also "/tmp/ycm_build_1xto_wp_/CMakeFiles/CMakeOutput.log".
See also "/tmp/ycm_build_1xto_wp_/CMakeFiles/CMakeError.log".
ERROR: the build failed.

NOTE: it is *highly* unlikely that this is a bug but rather
that this is a problem with the configuration of your system
or a missing dependency. Please carefully read CONTRIBUTING.md
and if you're sure that it is a bug, please raise an issue on the
issue tracker, including the entire output of this script
and the invocation line used to run it.

2. Soluciones

Ejecute el siguiente comando para instalarbuild-essential

imaginemiracle:~$ sudo apt-get update && sudo apt-get install build-essential

En este punto, mi propio problema ha sido resuelto. De acuerdo con la instalación anterior, no habrá más problemas. Sin embargo, es posible que el error anterior aparezca después de solo instalar esto. Debería ser debido g++a que g++. .

Supongo que te gusta

Origin blog.csdn.net/qq_36393978/article/details/127889737
Recomendado
Clasificación