That is…cruel. Have you filed an issue with the provider of that installer about this?
I got this resolved by adding “C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64” to PATH, but now it throws below error:
CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/Users/hchambet/work/aocc/llvm-build/Release/bin/clang-cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/hchambet/work/aocc/classic_flang/runtime/libpgmath/build/CMakeFiles/CMakeScratch/TryCompile-17pqcp
Run Build Command(s):C:/PROGRA~1/MIB055~1/2022/PROFES~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v cmTC_c8719 && [1/2] C:\Users\hchambet\work\aocc\llvm-build\Release\bin\clang-cl.exe /nologo /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_c8719.dir\testCCompiler.c.obj /FdCMakeFiles\cmTC_c8719.dir\ -c -- C:\Users\hchambet\work\aocc\classic_flang\runtime\libpgmath\build\CMakeFiles\CMakeScratch\TryCompile-17pqcp\testCCompiler.c
[2/2] cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_c8719.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2022\PROFES~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_c8719.dir\testCCompiler.c.obj /out:cmTC_c8719.exe /implib:cmTC_c8719.lib /pdb:cmTC_c8719.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: cmTC_c8719.exe
cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_c8719.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2022\PROFES~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_c8719.dir\testCCompiler.c.obj /out:cmTC_c8719.exe /implib:cmTC_c8719.lib /pdb:cmTC_c8719.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~1\MIB055~1\2022\PROFES~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_c8719.dir\testCCompiler.c.obj /out:cmTC_c8719.exe /implib:cmTC_c8719.lib /pdb:cmTC_c8719.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_c8719.dir/intermediate.manifest CMakeFiles\cmTC_c8719.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
ninja: build stopped: subcommand failed.
I tried adding library path to “PATH”, but it didn’t work. Any idea on how to solve this?
The Microsoft toolchain requires a lot more than just PATH
. You should really use vcvarsall.bat
to load the toolchain environment.