I just installed CLion on my computer with MinGW and decided to create a simple Hello World project to test it, but when I create it the console outputs an error:
>"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".
From what I understood, it failed to create some files in the project directory. Does anyone know why?
I should also point out that I was running into problems because my antivirus was detecting cmake temp files in appdata as viruses as well as the "Hello World\cmake-build-debug\CMakeFiles\3.6.3\CompilerIdC\a.exe" executable.
EDIT: It looks like I finally fixed it. From what I understand gcc.exe was not recognizing the project directory because it had spaces and other symbols like "ç" and "ã". So changing some folder names fixed the problem.