Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Cannot open source file <windows.h>

Tags:

c++

I'm new to C++ and I just got Visual Studio Community 2017. I don't quite know what workflow to use, so I went with my gut.

When I try to include windows.h using #include <windows.h>, I get a squiggly line underneath, and when I hover over, it says

cannot open source file "windows.h"

This is the same with conio.h and stdio.h.

Screenshot

like image 736
Jacob Avatar asked Dec 17 '22 22:12

Jacob


1 Answers

I seem to have found the issue

Solved!

  1. Click Project (top)

  2. Click properties (bottom)

  3. Under configuration properties, Click General

  4. Under general, click windows SDK version. If it is at 10.x put it to 8.1 then close then put it back to 10.x again.

Seemed to work for me.

like image 152
Jacob Avatar answered Jan 08 '23 07:01

Jacob