Build errors in Visual Studio

Viewed 844

Recently, I want to develop a simple app and I started to use Visual Studio. Therefore, I am not familiar with it. I started with a simple "Hello World" code, which is the default one. However, the build errors happen and the system said it cannot find the designated file. I have no idea how to fix them. Below is the error code:

1>------ Build started: Project: test, Configuration: Debug x64 ------
1>test.cpp
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include\yvals.h(12,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thank you in advance for your help!!

Edit:

From Visual Studio Installer

From Visual Studio > Project > Properties

Edit 2:

The VC++ Directories Page

From VoidTools Everything

1 Answers

I had this problem when I installed Visual Studio 2022 on 3 of my computers running windows 10 (I wondered if I was just my Main PC acting up), but my new Windows 11 PC worked fine. After much tinkering I found the if I removed the windows 10 SDK from the Visual Studio installer and then installed it directly (from the stand-alone downloader and not through Visual Studio), did a reboot it all works!

Related