小编Jim*_*sen的帖子

CLion:错误:C编译器"C:/MinGW/bin/gcc.exe"无法编译简单的测试程序

我正在尝试使用MinGW在Windows 7上运行CLion但由于某种原因,CMake无法编译简单的测试程序,但是当我创建一个简单的hello world文件时,当我直接调用编译器而不是CMake时,它编译得很好.

我已经尝试了几个版本的MinGW,但它对错误没有任何影响.我甚至卸载了我的AV,看看是不是问题,但再一次没有任何改变.

我的MinGW在我的路上也是CMake.起初我以为它可能是TEMP文件夹上的权限问题,但它们看起来都很好.我也在管理员帐户上.

这是我在CLion中遇到的错误:

Error: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: C:/Users/Jim/.clion10/system/cmake/generated/4cb6a70c/4cb6a70c/__default__/CMakeFiles/CMakeTmp
Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTryCompileExec141319549/fast"
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec141319549.dir\build.make CMakeFiles/cmTryCompileExec141319549.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/Jim/.clion10/system/cmake/generated/4cb6a70c/4cb6a70c/__default__/CMakeFiles/CMakeTmp'
"C:\Program Files (x86)\JetBrains\CLion 1.0\bin\cmake\bin\cmake.exe" -E cmake_progress_report C:\Users\Jim\.clion10\system\cmake\generated\4cb6a70c\4cb6a70c\__default__\CMakeFiles\CMakeTmp\CMakeFiles 1
CMakeFiles\cmTryCompileExec141319549.dir\build.make:56: recipe for target 'CMakeFiles/cmTryCompileExec141319549.dir/testCCompiler.c.obj' failed
process_begin: CreateProcess(C:\Users\Jim\AppData\Local\Temp\make68804-1.bat, C:\Users\Jim\AppData\Local\Temp\make68804-1.bat, ...) failed.
make (e=2): Het systeem kan het opgegeven bestand niet vinden.
mingw32-make.exe[1]: *** [CMakeFiles/cmTryCompileExec141319549.dir/testCCompiler.c.obj] Error 2
mingw32-make.exe[1]: Leaving directory 'C:/Users/Jim/.clion10/system/cmake/generated/4cb6a70c/4cb6a70c/__default__/CMakeFiles/CMakeTmp'
Makefile:117: recipe …
Run Code Online (Sandbox Code Playgroud)

gcc mingw cmake clion

11
推荐指数
1
解决办法
2万
查看次数

标签 统计

clion ×1

cmake ×1

gcc ×1

mingw ×1