Problem environment:
Microsoft Visual Studio Community 2022 (64-bit)
Windows SDK 10.0.19041.685
The problem is caused by an incorrect include directory set automatically by VS.
And the wrong path shown in the image above is provided by the macro $(UCRTContentRoot)
.
The value of this macro is taken from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10
the value of a registry key that may be set to the wrong value when installing some SDK-related packages:
To solve this problem, we can delete the wrong registry key and find the SDK installer to fix it:
or directly modify the value of the registry key to the correct path (eg: C:\Program Files (x86)\Windows Kits \10).