1
votes

I'm trying to compile a hello world file in clion but I keep getting this error

"C:\Program Files\JetBrains\CLion 2018.3.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\NAME\CLionProjects\HelloWorld 
CMake Error at C:/Program Files/JetBrains/CLion 2018.3.1/bin/cmake/win/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:523 (file): 
    file STRINGS file
    "C:/Users/NAME/CLionProjects/HelloWorld/cmake-build-debug/CMakeFiles/3.13.1/CompilerIdC/a.exe"
    cannot be read. 

How do I get rid of it?

Image of tooltip section

EDIT:

I keep getting the following compile error:

====================[ Build | HelloWorld | Debug ]============================== "C:\Program Files\JetBrains\CLion 2018.3.1\bin\cmake\win\bin\cmake.exe" --build C:\Users\ssez\CLionProjects\HelloWorld\cmake-build-debug --target HelloWorld -- -j 4 [ 33%] Linking C executable HelloWorld.exe c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot open output file HelloWorld.exe: Permission denied collect2.exe: error: ld returned 1 exit status mingw32-make.exe[3]: * [HelloWorld.exe] Error 1 CMakeFiles\HelloWorld.dir\build.make:99: recipe for target 'HelloWorld.exe' failed mingw32-make.exe[2]: [CMakeFiles/HelloWorld.dir/all] Error 2 CMakeFiles\Makefile2:71: recipe for target 'CMakeFiles/HelloWorld.dir/all' failed mingw32-make.exe1: [CMakeFiles/HelloWorld.dir/rule] Error 2 CMakeFiles\Makefile2:83: recipe for target 'CMakeFiles/HelloWorld.dir/rule' failed mingw32-make.exe: * [HelloWorld] Error 2 Makefile:117: recipe for target 'HelloWorld' failed

1
"C:\Program Files\JetBrains\CLion 2018.3.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\NAME\CLionProjects\HelloWorld CMake Error at C:/Program Files/JetBrains/CLion 2018.3.1/bin/cmake/win/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:523 (file): file STRINGS file "C:/Users/NAME/CLionProjects/HelloWorld/cmake-build-debug/CMakeFiles/3.13.1/CompilerIdC/a.exe" cannot be read.SSEZ
Could you add your code to your post? (the content of the HelloWorld file, I guess)Antoine Boisier-Michaud
The miles-long path names don't help anything, but maybe you can't avoid that. It appears that a file called either STRINGS or a.exe is missing. What happens next depends on which of those hypotheses is correct (if either), and where the file should be located etc. I think that we'll need a lot more information, most of which is not really related to programming per se — it feels from here like a setup problem. Have you been able to build any other programs? Since this is "Hello World", I'm guessing not. (I don't use CLion or CMake or Windows routinely, so I can't help much — sorry!)Jonathan Leffler
#include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; }SSEZ
A very simple c program. I have a feeling that something might be messed up in the tool configurations. This is my first time using CLion so a mistake in setup could definitely be a possibility. If it helps, Im using it with mingwSSEZ

1 Answers

0
votes

Did you setup the toolchain in CLion after you installed both MinGW and CLion?

File > Settings > Build, Execution, Deployment > Toolchains

CLion can normally autodetect the compilers that it knows about, however I believe that it still has to be told which compiler to look for at first.