Compiling with Visual Studio 2022
inikulshin opened this issue · comments
On May 22, 2024 Microsoft released new Windows SDK (https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)
After installing it I was unable to build win32/build.bat with Visual Studio 2019 and toolset v142:
libucrt.lib(checkcfg.obj) : error LNK2001: unresolved external symbol _guard_check_icall_$fo$
Enabling Visual Studio 2022 with toolset v143 in win32/common.vcxproj resolved the issue it for me:
<!-- Visual Studio 2022 (17.0) -->
<PropertyGroup Condition="'$(VisualStudioVersion)' == '17.0'">
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
FYI
Visual Studio 2019 cannot build with new SDK and /guard:cf
.
Either build with Visual Studio 2022 toolset or use older SDK 10.0.17763.0.
See: dotnet/corert#7451
FYI: In my case for VS2022, I could not upgrade to the 143 toolset, but changing the project properties from Windows SDK Version = "10.0 (latest version)" to the prior version '10.0.22621.0" worked around the issue for now.