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

17,586

Solution 1

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.

Solution 2

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)

Solution 3

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

Share:
17,586

Related videos on Youtube

Violet Giraffe
Author by

Violet Giraffe

I'm from Kharkiv, Ukraine. My city is being destroyed every day. Help us defend: https://www.comebackalive.in.ua/donate PC enthusiast, C++ fan and C++ / Qt / Android software developer. Also &lt;3 Arduino. Music and car addict. Reinventing various wheels in my spare time. A custom-made square wheel is like a tailored suit, wouldn't you agree? Why do I have more rep from questions than from answers? Because you don't learn by answering; you learn by asking questions :) Ongoing personal open-source projects: Dual-panel file manager for Windows / Linux / Mac

Updated on June 04, 2022

Comments

  • Violet Giraffe
    Violet Giraffe almost 2 years

    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?

    • benjymous
      benjymous over 10 years
      Are you using include "VersionHelpers.h" instead of include <VersionHelpers.h> by any chance?
    • Violet Giraffe
      Violet Giraffe over 10 years
      @benjymous: No, I am using angle braces as supposed to.
    • David Heffernan
      David Heffernan over 10 years
      What version of VS, which toolset are your targetting?
    • harper
      harper over 10 years
      Is this the only header file you can't open? Are other header files in the same directory that you successfully #include from your source? Than you can try to write the include line completely new, it might be an invalid (non-ANSI) character in the name.
    • Violet Giraffe
      Violet Giraffe over 10 years
      @DavidHeffernan: VS 2103, 2013 toolset.
    • Violet Giraffe
      Violet Giraffe over 10 years
      @harper: that's a good idea, but no, that's not it.
  • Violet Giraffe
    Violet Giraffe over 10 years
    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.
  • David Heffernan
    David Heffernan over 10 years
    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.