1

I installed the visual studio 2022 community edition with a C++ Desktop development packageScreenshot of Visual Studio Installer. When a new console application is built getting errors C++ standard libraries could not be found. Please let me know how to resolve this issue.Screenshot of Visual Studio 2022 build errors.

Shreevatsa
  • 29
  • 1
  • 4
  • Those are all IntelliSense errors, and should be taken as an approximation. What happens if you compile the project? (Remove IntelliSense errors from the error list filter.) – molbdnilo Dec 13 '21 at 09:37
  • OK, Now i am getting the following error "Error C1083 Cannot open include file: 'crtdbg.h': No such file or directory" – Shreevatsa Dec 13 '21 at 09:42
  • Can you show us some configuration screens of your project? – cic Dec 13 '21 at 10:12
  • Did repairing Visual Studio work? Please check whether the Windows SDK version in your project configuration is latest. – Minxin Yu - MSFT Dec 14 '21 at 07:37

3 Answers3

2

Start Visual Studio Installer and select "desktop development with C++".

cic
  • 106
  • 4
  • The package mentioned by you was selected at the time of installation. Code building with errors. – Shreevatsa Dec 13 '21 at 09:34
  • Try to repair Visual Studio. Start Visual Studio Installer and select More->repair – cic Dec 13 '21 at 10:11
  • In my case I had to uninstall and reinstall the Windows 10 SDK in the Visual Studio Installer to a different version. This was on a fresh install of Visual Studio 2022, so I'm not sure why it came with the wrong SDK version (or why the other SDK didn't work). – Oliver Apr 28 '22 at 02:18
0

For me VS2022 17.2.6 required both "Desktop development with C++" and "Windows 11 SDK" enabled in the installation details on the right hand side. I had the Windows 10 SDK enabled before but (as the name might suggest) that was insufficient since I am running Windows 11.

In case you do not know where to find those settings: --> Visual Studio Installer --> Modify button next to your VS 2022 installation

h_uat
  • 33
  • 4
0

To fix the error, you need to specify the installed SDK version in the project's properties -> Windows SDK Version.

Minxin Yu - MSFT
  • 2,234
  • 1
  • 3
  • 14