CXXコンパイラの識別は不明です



Cxx Compiler Identification Is Unknown



1.問題

cmakeで次のエラーが発生しました:

-- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is unknown -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done CMake Error at CMakeLists.txt:1 (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.

2.分析

このエラーの理由は、cmakeがC ++コンパイラを見つけることができないためです(たとえば、g ++が見つかりません)



3.解決する

(1)ソフトウェアソースを更新する

sudo apt-get update



(2)ビルドエッセンシャルをインストールします



もう1つ:gccにはg ++が含まれていないためです。 G ++は個別にインストールできます

apt-get install g ++

(3)g ++バージョンを表示する

g ++ --version