Error: The C compiler is not able to compile a simple test program
Hello Community! I am here with a problem I am struggling with since I got CLion Installed and tried to test my C++ code. But without even being able to run the code I have this text in the Debug panel:
"C:\Program Files\JetBrains\CLion 2019.3.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - NMake Makefiles" C:\Users\Owner\CLionProjects\untitled
-- The C compiler identification is MSVC 19.24.28314.0
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx86/x86/cl.exe -- broken
CMake Error at C:/Program Files/JetBrains/CLion 2019.3.1/bin/cmake/win/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx86/x86/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Owner/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):nmake /nologo cmTC_167a6\fast && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\nmake.exe" -f CMakeFiles\cmTC_167a6.dir\build.make /nologo -L CMakeFiles\cmTC_167a6.dir\build
Building C object CMakeFiles/cmTC_167a6.dir/testCCompiler.c.obj
"C:\PROGRA~2\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx86\x86\cl.exe" @C:\Users\Owner\AppData\Local\Temp\nm895F.tmp
testCCompiler.c
Linking C executable cmTC_167a6.exe
"C:\Program Files\JetBrains\CLion 2019.3.1\bin\cmake\win\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_167a6.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- "C:\PROGRA~2\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx86\x86\link.exe" /nologo @CMakeFiles\cmTC_167a6.dir\objects1.rsp @C:\Users\Owner\AppData\Local\Temp\nm89BD.tmp
RC Pass 1: command "rc /fo CMakeFiles\cmTC_167a6.dir/manifest.res CMakeFiles\cmTC_167a6.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the file specifiedNMAKE : fatal error U1077: '"C:\Program Files\JetBrains\CLion 2019.3.1\bin\cmake\win\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
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 "C:/Users/Owner/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Owner/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeError.log".
[Previous CMake output restored: 2019-12-17 12:47]
Please sign in to leave a comment.
Hello!
Most likely rc.exe is not in the
PATH.Please try adding the path to rc.exe to your system path: Control Panel ⇒ (Optional) System and Security ⇒ System ⇒ Advanced System Settings ⇒ Advanced tab ⇒ Environment Variables ⇒ System Variables ⇒ Select variable named "PATH" ⇒ Edit ⇒ Add the necessary path to the existing PATH entry.
I only have PATHEXT and Path... Which?
Path
Hmm, so what path I need to create?
According to the "RC Pass 1" ... "The system cannot find the file specified", rc.exe can't be found. So you need to add the path to rc.exe to your system path (the Path environment variable).
I mean I am not sure what path to type in...
You need to find rc.exe on your machine. It should be part of Windows Kits, I think. It's not a CLion-related question actually.