CMake missing rc.exe needs Windows SDK
If Visual Studio was just installed or upgraded, the Windows SDK may also need to be installed or updated (via the same Visual Studio Installer).
The symptoms of needing Windows SDK install or upgrade with CMake may be upon doing the usual:
cmake -B build
that you get errors like
-- The C compiler identification is MSVC 19.25
-- The CXX compiler identification is MSVC 19.25
-- Check for working C compiler: bin/Hostx64/x64/cl.exe
-- Check for working C compiler: bin/Hostx64/x64/cl.exe - broken
CMake Error at CMakeTestCCompiler.cmake:60 (message):
The C compiler
"bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Run Build Command(s):nmake /nologo cmTC_c0691\fast && "bin\HostX64\x64\nmake.exe" -f CMakeFiles\cmTC_c0691.dir\build.make /nologo -L CMakeFiles\cmTC_c0691.dir\build
Building C object CMakeFiles/cmTC_c0691.dir/testCCompiler.c.obj
bin\Hostx64\x64\cl.exe @AppData\Local\Temp\nmC03F.tmp
testCCompiler.c
Linking C executable cmTC_c0691.exe
"cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_c0691.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_c0691.dir\objects1.rsp @AppData\Local\Temp\nmC12A.tmp
RC Pass 1: command "rc /fo CMakeFiles\cmTC_c0691.dir/manifest.res CMakeFiles\cmTC_c0691.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the file specifiedNMAKE : fatal error U1077: '"cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.