Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I just installed visual studio and ran into some errors specifically The WindowsSDKDir property is not defined. Some build tools may not be found

Just installed visual studio 2019 on windows 10, was using visual studio for the first time and ran into the following error, It's a basic hello world console program that I tried to run.

error C1083: Cannot open include file: 'corecrt.h': No such file or directory
1>Done building project "ConsoleApplication2.vcxproj" -- FAILED.

Severity Code Description Project File Line Suppression State Warning MSB8003 The WindowsSDKDir property is not defined. Some build tools may not be found. ConsoleApplication2 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets 434

I tried searching for this error over YouTube and of course here, and also Microsoft's offical forum but couldn't find anything.

#include <iostream>
using namespace std;
int main()
{
    cout << "Hello World!\n";
}

the code looks just fine.

like image 774
Pawan Nirpal Avatar asked Jul 13 '19 12:07

Pawan Nirpal


2 Answers

I ran into the same issue today. It turns out I didn't check the Win10SDK to save disk space while installation.

Solution:

In VS, go Tools menu=>Get Tools and Features=>install the Windows 10 SDK(10.XX.XX.XX)

Once installed, launch VS and open your project, right-click your project(NOT Solution)->properties->General->Windows SDK Version, check the value should be 10.0 instead of blank. Then the compiling just worked.

like image 111
Frank Miller Avatar answered Sep 18 '22 13:09

Frank Miller


I've got the same issue and turned out that I haven't installed Windows SDK. It can be done by typing "Install Windows SDK" into visual studio's search prompt

like image 40
Borys Petrov Avatar answered Sep 17 '22 13:09

Borys Petrov