Cannot build console application with Microsoft Visual Studio 2019

  • Thread starter Thread starter amannuc
  • Start date Start date
A

amannuc

Guest
I just installed the community version of VS 2019. I selected to build a console application that it created for me ("hello world" program). The file created is called ConsoleApplication1.cpp. I went to the build menu, selected build, and get the following error:

1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(441,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found.

1>ConsoleApplication1.cpp

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\yvals.h(12,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory

1>Done building project "ConsoleApplication1.vcxproj" -- FAILED.

I tried to follow directions I saw on stackexchange. When I select "Project -> Properties" the Windows SDK field is blank. A value I typed in from another StackExchange message creates an error that that version of the SDK cannot be found. So I made the SDK field blank again. I also tried using "10.0", but that did nothing.

Perhaps I did not install all the needed components. I recently checked off: "Windows Universal CRT SDK" (as per something I saw on stackexchange), but the build still fails. The warning is interesting. I looked that up also but have not found a solution that works. My "Platform Toolset" is Visual Studio 2019 (v142).

What might still be missing to build a console application? Thank you. I am working on Windows 7.

Continue reading...
 
Back
Top