Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 can't find windows.h

Tags:

c++

windows

Hell'o I've just installed Visual Studio 2017 (enterprise).I opened my project whom I created in Visual Studio 2015. My project uses windows.h library but VS2017 cannot find this library. How to repair this?

like image 404
Marcin Klima Avatar asked Apr 14 '17 11:04

Marcin Klima


People also ask

Where is the Windows h file located?

h? There's no preset location. These files are not included with a base Windows installation. Their location depends on where you have installed Visual Studio, or the Windows API.

Can not include Windows H?

h'". That problem happens because the file, which is needed to compile programs that make calls to the Windows operating system, is not installed. To fix this, download and install the Microsoft Windows SDK for your system (it is free). Once the SDK is installed, add the file paths to Visual Studio.

What is #include Windows H?

h is a Windows-specific header file for the C and C++ programming languages which contains declarations for all of the functions in the Windows API, all the common macros used by Windows programmers, and all the data types used by the various functions and subsystems.


2 Answers

My solution was :

  • Open the project properties
  • Into General --> SDK Version
  • I just picked the 10.0.15063.0 version instead of 8.1

And it worked.

like image 105
ImFonky Avatar answered Oct 14 '22 19:10

ImFonky


I solved this issue by re-running the Visual Studio Installer and selecting the "Modify" button. Once presented with the Workloads screen I clicked on the "Individual Components" tab and selected all of the latest "Windows 10 SDK" Checkboxes(version 10.0.15063.0). My guess is that the entry for "Desktop C++ x86 and x64" is the one the actually fixes it but it is only speculation because none of those options were checked when I ran the installer and as you can see I checked all of them.

enter image description here

like image 42
James Pack Avatar answered Oct 14 '22 18:10

James Pack