Cannot open include file: 'crtdbg.h'

Receiving the following error when executing “cl triplex.cpp”:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\yvals.h(12): fatal error C1083: Cannot open include file: ‘crtdbg.h’: No such file or directory

Following is my console:

I have the “Unreal Engine installer” selected as part of the “Game development with C++”. And when I select individual components it shows Windows Universal C Runtime is selected.

I did view another topic that had the same issue but could still not get mine to work.


More information:
I also added the location of the crtdbg.h file to the LIB environment variable:

That is strange. Have you installed the Windows SDK outside of Visual Studio as well?

No, I had not installed it outside of Visual Studio.

Went ahead and downloaded it outside of Visual Studio. When installing it states everything is up to date:

This did not help with the issue.


I wasn’t recommending you do that. I’ve just heard that that has caused someone an issue before. Have you try reinstalling Visual Studio?

I actually reinstalled everything. Still having the same issue. Decided to try on another (home vs work) computer and everything worked.

It appears to be something with the pre-processor directive - when removing the #include , it compiles. Of course that’s without needing the iostream stuff.

I’ll probably just work on my home computer for now. Curiosity is driving me to figure this out so if I figure anything else out, I’ll add to this thread.

Thanks for your help.

It’s a transitive include. When you include iostream you’ll end up including that with Microsoft’s implementation. It should be installed by the Windows SDK so it’s a bit odd.

By default the path it should be in is

C:\Program Files (x86)\Windows Kits\10\Include\{version_number}\ucrt

You could try installing a different Windows 10 SDK version in the installer?