Sto provando a compilare un progetto git e sto affrontando alcuni problemi con CMake. Inizialmente, non ha trovato il compilatore C++ e ha spinto un errore:Errori durante la compilazione con CMake
cmake ..
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.
Così, ho fatto:
CXX="gcc" cmake ..
Ma un altro errore è stato chiesto:
-- The CXX compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/gcc
-- Check for working CXX compiler: /usr/bin/gcc -- broken
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/gcc" is not able to compile a simple test program.
Come posso risolvere questo errore e compilare il progetto?
Stai cercando di utilizzare CMake su un sistema Linux o Mac OS? CMake dovrebbe essere in grado di rilevare automaticamente il compilatore predefinito sulla macchina. Cosa restituisce il comando 'g ++ -v' in un terminale? – Antwane
Sistema Linux. A proposito di 'g ++ -v', lancia un" comando non trovato ". – Patrick