我刚安装了克利翁,并决定建立一个简单的Hello World项目来测试它,但是当我创建它的控制台输出错误:克利翁 - CMake的错误,而我的电脑使用MinGW创造新的项目
>"C:\Program Files (x86)\JetBrains\CLion 2016.3.3\bin\cmake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" "E:\Programação\C++\Hello World"
>-- The C compiler identification is GNU 5.3.0
>-- The CXX compiler identification is GNU 5.3.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:/Program Files (x86)/JetBrains/CLion 2016.3.3/bin/cmake/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (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: Hello World/cmake-build-debug/CMakeFiles/CMakeTmp
> Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_11be0/fast"
> C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_11be0.dir\build.make
CMakeFiles/cmTC_11be0.dir/build
> mingw32-make.exe[1]: Entering directory 'Hello
World/cmake-build-debug/CMakeFiles/CMakeTmp'
> Building C object CMakeFiles/cmTC_11be0.dir/testCCompiler.c.obj
> C:\MinGW\bin\gcc.exe -o CMakeFiles\cmTC_11be0.dir\testCCompiler.c.obj -c
"Hello
World\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c"
> gcc.exe: error: Hello
World\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file
or directory
> gcc.exe: fatal error: no input files
> compilation terminated.
> CMakeFiles\cmTC_11be0.dir\build.make:64: recipe for target
'CMakeFiles/cmTC_11be0.dir/testCCompiler.c.obj' failed
> mingw32-make.exe[1]: *** [CMakeFiles/cmTC_11be0.dir/testCCompiler.c.obj]
Error 1
> mingw32-make.exe[1]: Leaving directory 'Hello
World/cmake-build-debug/CMakeFiles/CMakeTmp'
> Makefile:125: recipe for target 'cmTC_11be0/fast' failed
> mingw32-make.exe: *** [cmTC_11be0/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 "Hello World/cmake-build-debug/CMakeFiles/CMakeOutput.log".
>See also "Hello World/cmake-build-debug/CMakeFiles/CMakeError.log".
从我的理解,它无法在项目目录中创建一些文件。有谁知道为什么?
我还应该指出,我遇到了问题,因为我的杀毒软件检测到appdata中的cmake临时文件是病毒,以及“Hello World \ cmake-build-debug \ CMakeFiles \ 3.6.3 \ CompilerIdC \ a .exe“可执行文件。编辑: 它看起来像我终于修好了。从我所了解的gcc.exe不能识别项目目录,因为它有空格和其他符号,如“ç”和“ã”。所以改变一些文件夹名称可以解决问题。
'我也陷入了因为我的防病毒问题正在检测appdata中的cmake临时文件为病毒 - 所以,你知道它为什么不适合你。你想从我们这里得到什么? – Tsyvarev
@Tsyvarev我已经添加了防病毒的例外,它似乎不再打扰我了。只是为了确定我删除并重新创建了该项目,但它仍然发生。 – MPDR
为什么你确定防病毒问题已经消失?你仍然会丢失应该存在的文件(比如'CMakeFiles \ CMakeTmp \ testCCompiler.c')。 – Tsyvarev