Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open include file: 'VersionHelpers.h': No such file or directory

I'm trying to use IsWindows7SP1OrGreater function, declared in VersionHelpers.h header. And I get:

'VersionHelpers.h': No such file or directory

although I can open this header from Visual Studio, it is found by syntax checker correctly. What's the problem?

like image 560
Violet Giraffe Avatar asked Oct 23 '13 10:10

Violet Giraffe


3 Answers

Yeah... Its right that VersionHelpers.h included in the VS2013 Windows 8.1 SDK.

For those using VS2012, you will have to redownload the Win 8.1 SDK and install it. Navigate to the Program Files(x86)\Windows Kits\8.1\Include\um. Copy all files and paste into 8.0\Include\um . Its better to skip all existing files. Reload VS

like image 115
Rarr Avatar answered Nov 12 '22 06:11

Rarr


I had that problem myself, and I couldn't find the file anywhere on my disk.

Then I just realized the file seems to be included only in the Windows 8.1 SDK (and future SDKs to come I suppose), in the C:\Program Files (x86)\Windows Kits\8.1\Include\um path. The doc doesn't mention that (so you don't need Visual Studio 2013 to be able to use it)

like image 36
Simon Mourier Avatar answered Nov 12 '22 06:11

Simon Mourier


In order to use the version helpers macros, you need to be targetting the v120 platform toolset this ships with VS 2013. If you create a an empty project in VS 2013 then you will find that an include of VersionHelpers.h works fine.

If you are targetting v120 then I guess something else is misconfigured in your project. Start with a brand new project and convince yourself that #include <VersionHelpers.h> works as expected. Then try to find out what's different between your troublesome project, and the plain vanilla project that works.

like image 9
David Heffernan Avatar answered Nov 12 '22 06:11

David Heffernan