Error when trying to Configure project with Ninja in CMAKE 3.15.2 in Visual Studio Code on Win10 using Visual Studio Community 2019
Hello,
Here is the output of CMakeError.log
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
Build flags:
Id flags:
The output was:
2
Microsoft (R) C/C++ Optimizing Compiler Version 19.23.28106.4 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCCompilerId.c
Microsoft (R) Incremental Linker Version 14.23.28106.4
Copyright (C) Microsoft Corporation. All rights reserved.
/out:CMakeCCompilerId.exe
CMakeCCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
Build flags:
Id flags:
The output was:
2
Microsoft (R) C/C++ Optimizing Compiler Version 19.23.28106.4 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.23.28106.4
Copyright (C) Microsoft Corporation. All rights reserved.
/out:CMakeCXXCompilerId.exe
CMakeCXXCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
Determining if the C compiler works failed with the following output:
Change Dir: C:/Users/GabrielaBotea/source/repos/temp/TheRigg/Core/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/PROGRA~2/MICROS~1/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_b8cfe && [1/2] Building C object CMakeFiles\cmTC_b8cfe.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_b8cfe.exe
FAILED: cmTC_b8cfe.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_b8cfe.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_b8cfe.dir\testCCompiler.c.obj /out:cmTC_b8cfe.exe /implib:cmTC_b8cfe.lib /pdb:cmTC_b8cfe.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 && cmd.exe /C "cd /D C:\Users\GabrielaBotea\source\repos\temp\TheRigg\Core\build\CMakeFiles\CMakeTmp && powershell -noprofile -executionpolicy Bypass -file C:/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/Users/GabrielaBotea/source/repos/temp/TheRigg/Core/build/CMakeFiles/CMakeTmp/cmTC_b8cfe.exe -installedDir C:/vcpkg/installed/x64-windows/debug/bin -OutVariable out""
RC Pass 1: command "rc /fo CMakeFiles\cmTC_b8cfe.dir/manifest.res CMakeFiles\cmTC_b8cfe.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the file specified
ninja: build stopped: subcommand failed.
Here is the output of set v
set v
VCIDEInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.23.27820\
VCToolsVersion=14.23.28105
VisualStudioVersion=16.0
VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x86
VSCMD_ARG_TGT_ARCH=x86
VSCMD_VER=16.3.3
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\
This is what I found in CMakeCache.txt
CMAKE_MT:FILEPATH=CMAKE_MT-NOTFOUND
CMAKE_RC_COMPILER:FILEPATH=rc
The generator work when I use the Visual Studio Community 2019
generator, but it fails when I try to use Ninja. It seems to not be able to find the Windows 10 Kits for x64.