2017-09-02 111 views
-1

我在C語言編程初學者,我得到這個錯誤代碼,如果我開始在克利翁的一個項目:CMake的錯誤與克利翁

C:\Program Files\JetBrains\CLion 2017.2.2\bin\cmake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\danie\CLionProjects\untitled2 
-- The C compiler identification is GNU 5.3.0 
-- The CXX compiler identification is unknown 
-- Check for working C compiler: C:/MinGW/bin/gcc.exe 
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- 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:2 (project): 
    The CMAKE_CXX_COMPILER: 

g++.exe 

is not a full path and was not found in the PATH. 

告訴CMake的地方設置任何環境 變量來查找編譯「CXX」或CMake緩存條目CMAKE_CXX_COMPILER添加到編譯器的完整路徑 ,或者如果編譯器名稱位於PATH中,則爲編譯器名稱。

-- Configuring incomplete, errors occurred! 
See also "C:/Users/danie/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeOutput.log". 
See also "C:/Users/danie/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeError.log". 

[完成]

我能做些什麼來得到它的工作? 謝謝你的幫助。

+0

看來你已經安裝了C編譯器('gcc'),但不是C++編譯器('G ++')。 –

+0

我在C編程,所以我不需要一個C++編譯器。 –

回答

3

默認情況下,CMake預計該項目需要支持C和C++。如果你的項目只需要C,指定在project()電話:

project(<project-name> C)