clion环境配置出错,cmake出错,导致简单main.cpp程序不能执行
"C:\clion\CLion 2019.1.2\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" E:\clion\clion工程文件夹
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: C:/mingw/bin/gcc.exe
-- Check for working C compiler: C:/mingw/bin/gcc.exe -- broken
CMake Error at C:/clion/CLion 2019.1.2/bin/cmake/win/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/mingw/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/mingw/bin/mingw32-make.exe cmTC_c1b8b/fast
C:/mingw/bin/mingw32-make.exe -f CMakeFiles\cmTC_c1b8b.dir\build.make CMakeFiles/cmTC_c1b8b.dir/build
mingw32-make.exe[1]: Entering directory 'E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj
C:\mingw\bin\gcc.exe -o CMakeFiles\cmTC_c1b8b.dir\testCCompiler.c.obj -c E:\clion\clion瀹搞儳鈻奸弬鍥︽婢剁cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: E:\clion\clion瀹搞儳鈻奸弬鍥︽婢剁cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
CMakeFiles\cmTC_c1b8b.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_c1b8b/fast' failed
mingw32-make.exe: *** [cmTC_c1b8b/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeError.log".
[Finished]
不知为什么cmake出现错误请求各位大神帮帮忙
感谢了!!!
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: C:/mingw/bin/gcc.exe
-- Check for working C compiler: C:/mingw/bin/gcc.exe -- broken
CMake Error at C:/clion/CLion 2019.1.2/bin/cmake/win/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/mingw/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/mingw/bin/mingw32-make.exe cmTC_c1b8b/fast
C:/mingw/bin/mingw32-make.exe -f CMakeFiles\cmTC_c1b8b.dir\build.make CMakeFiles/cmTC_c1b8b.dir/build
mingw32-make.exe[1]: Entering directory 'E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj
C:\mingw\bin\gcc.exe -o CMakeFiles\cmTC_c1b8b.dir\testCCompiler.c.obj -c E:\clion\clion瀹搞儳鈻奸弬鍥︽婢剁cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: E:\clion\clion瀹搞儳鈻奸弬鍥︽婢剁cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
CMakeFiles\cmTC_c1b8b.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_c1b8b/fast' failed
mingw32-make.exe: *** [cmTC_c1b8b/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeError.log".
[Finished]
不知为什么cmake出现错误请求各位大神帮帮忙
感谢了!!!
...全文
相关推荐
如何在 clion 运行多个 main 函数(方法详解)
一、问题的来源在编写 C++ 程序时,经常会遇到多个 main 函数的问题,特别是在写多个 cpp 文件时。这时,CLion 中可能会出现编译错误,无法同时存在多个 main 函数。
Clion+Qt 运行的例子
而Qt则是一个跨平台的应用程序开发框架,广泛用于创建图形用户界面(GUI)和其他软件。【Clion】:1. **项目管理**:Clion支持CMake构建系统,使得创建、管理和构建C++项目变得简单。
CLion Qt工程(包含cmake)
**main.cpp**:这是Qt应用程序的入口点,一般会包含`int main(int argc, char *argv[])`函数。在这里,会实例化QApplication对象并启动主窗口。3.
Clion搭建Qt环境.zip
例如,创建一个简单的Qt应用可能需要如下内容: ``` add_executable(MyQtApp main.cpp) target_link_libraries(MyQtApp ${Qt5Widgets_LIBRARIES
Opencv编译包,用于Clion配置Opencv开发环境
**添加源代码**: 在项目中创建一个名为"main.cpp"的源文件,这是你的主程序入口。


工具平台和程序库
