1

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.

MPDR
  • 13
  • 1
  • 1
  • 5
  • `I was running into problems because my antivirus was detecting cmake temp files in appdata as viruses` - So, you know why it doesn't work for you. What do you want from us? – Tsyvarev Mar 08 '17 at 21:54
  • @Tsyvarev I've added the exceptions on the antivirus and it seemed to not bother me anymore. And just to be sure I deleted and recreated the project but it still happens. – MPDR Mar 08 '17 at 22:40
  • Why are you sure that problem with antivirus has gone away? You still lose files (like `CMakeFiles\CMakeTmp\testCCompiler.c`) which should exist. – Tsyvarev Mar 08 '17 at 22:46
  • Do you have GCC and G++ installed within the MinGW distribution? – nastasiak2512 Mar 09 '17 at 08:32
  • @Tsyvarev It wasn't giving me any warnings, but I took what you said into account and told the antivirus to ingore the folder with all the other projects I have from other languages, it still won't work, even after recreating the project. – MPDR Mar 09 '17 at 14:00
  • @nastasiak2512 I followed this tutorial: https://youtu.be/00_Nj94aDQk. Is anything wrong with it? – MPDR Mar 09 '17 at 14:02

1 Answers1

1
Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken

// Rest of log

gcc.exe: fatal error: no input files

These 2 lines mean that there is somethig wrong with the installation of CLion on your machine. I know this from experience, because I got this error myself the first time I installed CLion, using the same video you watched.

What I suggest is that you look at this video:

Install & Configure CLion Student Copy|| best IDE for C/C++ - Youtube Video

The reason I suggest this video is because it is the newest one available for installing CLion on a Windows 10 machine. What you should do is go over the entire video, and see how the MinGW packages are installed, which ones are installed, and how CLion is installed and set up. If you did anything different from this video, then that is probably the error you need to address. Just as an aside, I also used this video, and it worked for me.

If you followed all the insuctions in the video, then you should probably just uninstall MinGW and Clion and try it again; that's how I did it. But only do this as a last resort. First make sure that you did not miss anything in the tutorial, esoecially in how the MinGW packages were installed.

By the way, there was a similar question to this one, and the answer posted for it worked, so you may also want to look at that:

can't run any program in clion - StackOverflow post

Community
  • 1
  • 1
BusyProgrammer
  • 2,783
  • 5
  • 18
  • 31
  • 1
    I was struggling with the similar error for a whole day and a complete reinstall of CLion + removing Cygwin (which I have installed because of the other projects) from the PATH fixed the problem. Thank you. – Bojan P. Mar 26 '18 at 15:21