Gcc Clion with MinGW不编译简单的Hello World应用程序

Gcc Clion with MinGW不编译简单的Hello World应用程序,gcc,mingw,clion,Gcc,Mingw,Clion,我在用CLion和MinGW编译一个简单的hello world应用程序时遇到了麻烦。“运行”和“调试”按钮变灰 我已经用mingw32-gcc-g++和mingw32-make软件包安装了MinGW。 之后,我安装了CLion,它自动检测到MinGW的正确文件夹。但是,C编译器和C++编译器将不会得到复选标记。 在CMakeError.log文件中还发现以下内容: Compiling the C compiler identification source file "CMakeCComp

我在用CLion和MinGW编译一个简单的hello world应用程序时遇到了麻烦。“运行”和“调试”按钮变灰

我已经用mingw32-gcc-g++和mingw32-make软件包安装了MinGW。

之后,我安装了CLion,它自动检测到MinGW的正确文件夹。但是,C编译器和C++编译器将不会得到复选标记。

在CMakeError.log文件中还发现以下内容:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/MinGW/bin/gcc.exe 
Build flags: 
Id flags: 

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -c

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -Aa

The output was:
1


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
gcc.exe: fatal error: no input files
compilation terminated.
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/MinGW/bin/g++.exe 
Build flags: 
Id flags: 

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/MinGW/bin/g++.exe 
Build flags: 
Id flags: -c

The output was:
1


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
g++.exe: fatal error: no input files
compilation terminated.
Determining if the C compiler works failed with the following output:
Change Dir: D:/Users/Tau/.clion10/system/cmake/generated/94853116/94853116/__default__0/CMakeFiles/CMakeTmp

Run Build Command:C:/MinGW/bin/mingw32-make.exe "cmTryCompileExec3424130643/fast"
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec3424130643.dir\build.make CMakeFiles/cmTryCompileExec3424130643.dir/build

mingw32-make.exe[1]: Entering directory 'D:/Users/Tau/.clion10/system/cmake/generated/94853116/94853116/__default__0/CMakeFiles/CMakeTmp'

"C:\Program Files (x86)\JetBrains\CLion 138.2344.17\bin\cmake\bin\cmake.exe" -E cmake_progress_report D:\Users\Tau\.clion10\system\cmake\generated\94853116\94853116\__default__0\CMakeFiles\CMakeTmp\CMakeFiles 1

Building C object CMakeFiles/cmTryCompileExec3424130643.dir/testCCompiler.c.obj

C:\MinGW\bin\gcc.exe    -o CMakeFiles\cmTryCompileExec3424130643.dir\testCCompiler.c.obj   -c D:\Users\Tau\.clion10\system\cmake\generated\94853116\94853116\__default__0\CMakeFiles\CMakeTmp\testCCompiler.c

CMakeFiles\cmTryCompileExec3424130643.dir\build.make:56: recipe for target 'CMakeFiles/cmTryCompileExec3424130643.dir/testCCompiler.c.obj' failed

mingw32-make.exe[1]: Leaving directory 'D:/Users/Tau/.clion10/system/cmake/generated/94853116/94853116/__default__0/CMakeFiles/CMakeTmp'

mingw32-make.exe[1]: *** [CMakeFiles/cmTryCompileExec3424130643.dir/testCCompiler.c.obj] Error 1

Makefile:113: recipe for target 'cmTryCompileExec3424130643/fast' failed

mingw32-make.exe: *** [cmTryCompileExec3424130643/fast] Error 2

我搞不懂。我也尝试过cygwin x64,同样的问题也出现了。出什么事了?

在花了这么多时间没有任何线索之后,我发现实际上崩溃的软件是cc1.exe和cc1plus.exe。使用Dependency Waker工具(导致mo在这两个崩溃的exe附近手动添加zlib1.dll文件)后,我发现真正的原因是没有安装程序包mingw32 libz。 我已经在MinGW中安装了mingw32 libz软件包,并删除了手动添加的DLL,我在设置中获得了所有选中标记