CMake的错误与克利翁
问题描述:
我在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".
[完成]
我能做些什么来得到它的工作? 谢谢你的帮助。
答
默认情况下,CMake预计该项目需要支持C和C++。如果你的项目只需要C,指定在project()
电话:
project(<project-name> C)
看来你已经安装了C编译器('gcc'),但不是C++编译器('G ++')。 –
我在C编程,所以我不需要一个C++编译器。 –