Tag Archives: VS2022 ERROR

crtdbg.h No such file or directory error [How to Solve]

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.
macro

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\KitsRoot10the value of a registry key that may be set to the wrong value when installing some SDK-related packages:
reg

To solve this problem, we can delete the wrong registry key and find the SDK installer to fix it:
setup
repair
or directly modify the value of the registry key to the correct path (eg: C:\Program Files (x86)\Windows Kits \10).