【问题标题】:Clion with MinGW not compiling simple Hello World app带有 MinGW 的 Clion 无法编译简单的 Hello World 应用程序
【发布时间】:2014-11-12 11:27:13
【问题描述】:

我无法使用 CLion 和 MinGW 编译一个简单的 hello world 应用程序。运行和调试按钮是灰色的。

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

之后我安装了 CLion,它自动检测到 MinGW 的正确文件夹。但是make、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 并出现同样的问题。怎么了?

【问题讨论】:

    标签: gcc mingw clion


    【解决方案1】:

    经过这么长时间毫无头绪,我发现崩溃的软件实际上是cc1.exe和cc1plus.exe。使用 Dependency Waker 工具导致 mo 在这两个崩溃的 exe 附近手动添加 zlib1.dll 文件后,我发现真正的原因是没有安装包 mingw32-libz。 我已经在 MinGW 中安装了 mingw32-libz 包并删除了手动添加的 dll,我在设置中得到了所有复选标记。

    【讨论】:

      猜你喜欢
      • 2013-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-02
      • 2015-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多