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

Viewed 19014

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 Answers

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.

You should install the framework MFC
enter image description here

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.

Related