CLion的CMAKE错误 [英] CMAKE ERROR with CLion
问题描述
我是C语言编程的初学者,如果我在CLion上启动项目,则会收到此错误代码:
I am a beginner in programming with C and I get this error code if i start a project on CLion:
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中).
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 "C:/Users/danie/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/danie/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeError.log".
[完成]
我该怎么做才能使其正常工作? 谢谢您的帮助.
What can I do to get it working? Thank you for your help.
推荐答案
默认情况下,CMake期望该项目需要对C和C ++的支持.如果您的项目仅需要C,请在project()
调用中指定:
By default, CMake expects that project needs support for both C and C++. If your project needs only C, specify that in project()
call:
project(<project-name> C)
这篇关于CLion的CMAKE错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!