VS 2017: fatal error RC1015: cannot open include file 'winres.h'

22.9k views Asked by At

I just downloaded Visual Studio 2017 and converted my dialog-based C++/MFC project with it (from Visual Studio 2008 SP1.) But then when I go to Resources it shows this error:

fatal error RC1015: cannot open include file 'winres.h'

enter image description here

And idea how to fix this?

7

There are 7 answers

0
Mohamed Amine MAAROUFI On

You should install the framework MFC
enter image description here

0
Santosh Dhanawade On

Probably VS2017 fatal error RC1015 when attempting to add a new resource. fellow also got this error with VS2017.

0
Jeff T. On

I just also came across this issue. It seems my friend missed to push some VS 2017 meta file to the server. My quick solution is to change the Windows SDK version to match the Windows 10 OS version or below. enter image description here

You can check your OS version from the cmd tool. enter image description here

0
Mariano Desanze On

Jeff T. answer is great if you have a single project.

If you have many projects in which you have to change the target Windows SDK (or if you want to make sure they all match), you'll probably prefer to use the Retarget Solution button found when right clicking on the solution: 1. Right click on solution, 2. "Retarget Solution"

Then just select some Windows SDK version that you have installed, and apply it to all (or whatever) projects you need to change: 3. List of Windows SDK to choose and apply to all projects

That list of Windows SDK versions will probably show some that don't really work. You might have to try.

0
Dan Bradbury On

For anyone who stumbles onto this question is in the same boat as me (tried all of the above with no luck)..

I just created a fresh project and created a resource immediately (no issue) and then went ahead and readded all the code / libs that were needed. A bit annoying but I'm sure it was a mistake I made while configuring the project settings

Hopefully this helps someone out

0
Manas On

The missing files are located in two directories: C:\Program Files\Windows Kits\10\Include\10.0.15063.0\um C:\Program Files\Windows Kits\10\Include\10.0.15063.0\shared

Add the two paths to project properties (Project >> ...Properties >> Configuration Properties >> VC++ Directories >> Include Directories).

1
Vizor On

I my case, it was caused by wrong project configuration. Specifically Property Pages -> VC++ Directories -> Include Directories and there check Inherit from parent or project defaults.