10

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?

Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335

3 Answers3

9

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Yes, you're right. My header that includes `VersionHelpers` is in turn included into another project which uses v100 toolset. How come MSDN doesn't mention this issue, though? It even says that functions from VersionHelpers are available starting from Windows 2000. – Violet Giraffe Oct 23 '13 at 11:10
  • As I understand it, these macros stand on top of `VerifyVersionInfo` which is supported on Win2k. And so the macros inherit that. The macros are very simple. For your v100 tooling, if you need to continue using that, you could just add the include file into that project. – David Heffernan Oct 23 '13 at 11:15
5

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)

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
4

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

Rarr
  • 56
  • 1