CLion + MinGW Test CMake run finished with errors

已回答
 

I'm new on this IDE, and programming on Windows, I've installed MinGW and added to enviroment path and when I run CLion I have this error i've everything :

-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe -- broken
CMake Error at C:/Program Files/JetBrains/CLion 2019.1.1/bin/cmake/win/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler

"C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/BarnabaWĹ‚adcaPodziem/AppData/Local/Temp/cmake_check_environment/_build5308940856842346941/CMakeFiles/CMakeTmp

Run Build Command(s):C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/bin/mingw32-make.exe cmTC_652e3/fast
C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_652e3.dir\build.make CMakeFiles/cmTC_652e3.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/BarnabaW│adcaPodziem/AppData/Local/Temp/cmake_check_environment/_build5308940856842346941/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_652e3.dir/testCCompiler.c.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-P\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_652e3.dir\testCCompiler.c.obj -c C:\Users\BarnabaWładcaPodziem\AppData\Local\Temp\cmake_check_environment\_build5308940856842346941\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: C:\Users\BarnabaWładcaPodziem\AppData\Local\Temp\cmake_check_environment\_build5308940856842346941\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
mingw32-make.exe[1]: *** [CMakeFiles\cmTC_652e3.dir\build.make:65: CMakeFiles/cmTC_652e3.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/BarnabaW│adcaPodziem/AppData/Local/Temp/cmake_check_environment/_build5308940856842346941/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [Makefile:120: cmTC_652e3/fast] Error 2

 

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)


-- Configuring incomplete, errors occurred!
See also "C:/Users/BarnabaWĹ‚adcaPodziem/AppData/Local/Temp/cmake_check_environment/_build5308940856842346941/CMakeFiles/CMakeOutput.log".
See also "C:/Users/BarnabaWĹ‚adcaPodziem/AppData/Local/Temp/cmake_check_environment/_build5308940856842346941/CMakeFiles/CMakeError.log".

Error code: 1

评论操作 固定链接

Hello!

It's not a CLion problem, but a problem with using CMake + MinGW - they don't support non-latin symbols.

To solve the problem please do the following:

  1. Create temp folder in location which path doesn't include non-latin symbols (for example, C:\tmp).
  2. In CLion menu do Help | Edit Custom VM options....
  3. In the opened file add this line: -Djava.io.tmpdir=<path_to_temp_folder> (for example, -Djava.io.tmpdir=C:/tmp).
  4. In the menu do File | Save All.
  5. Restart CLion.

Also if path to your project contains non-latin symbols, please move the CMake generation directory to a path that doesn't contain such characters (either via File | Settings | Build, Execution, Deployment | CMake | Generation path, or just put the project itself to other location).

2
评论操作 固定链接

I had the same problem. Thank you Anna Falevskaya for help in solving it. :)

0
评论操作 固定链接

Hi Anna

Please i still have the same problem, is there any other instruction ? 

0
评论操作 固定链接

@Houssam Tamesna, if you faced the same problem with non-latin symbols, you need to fulfil two points from my previous comment:

  1. Set -Djava.io.tmpdir to the path which doesn't include non-latin symbols (the instruction is in the comment).
  2. If the path to your project contains non-latin symbols, you should move the CMake generation directory to a path that doesn't contain such characters (either via File | Settings | Build, Execution, Deployment | CMake | Generation path, or just put the project itself to other location).

Or you can simply use Cygwin instead of MinGW.

0
评论操作 固定链接

Hi,Anna.I hava the same problem,and i followed your method to set several times.But problem still existses.In addition,i think that my problem is not caused by non-latin symbols because i had created 6 C language learning projects successfully in my project directory,they could be compilered and run well.since i create 7th project,Cmake began to occur this problem,strangely,other project still could work.I unload and reload Clion and MinGW,a annoying happend all of C program could not be run ,Cmake reports errors for all.Is there others better solutions?

0

请先登录再写评论。