不能打开包含文件:“versionhelper”。没有这样的文件或目录。

时间:2023-02-22 00:26:52

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

我尝试使用IsWindows7SP1OrGreater函数,在versionhelper中声明。h头。我得到:

'VersionHelpers.h': No such file or directory

“VersionHelpers。没有这样的文件或目录。

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

虽然我可以从Visual Studio打开这个头,但是语法检查器可以正确地找到它。是什么问题?

3 个解决方案

#1


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.

为了使用版本帮助宏,您需要将v120平台工具设置为VS 2013。如果您在VS 2013中创建了一个空项目,那么您将会发现其中包含了versionhelper。h工作正常。

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.

如果你的目标是v120,那么我想在你的项目中还有其他的错误配置。从一个全新的项目开始,并说服自己#包括< versionhelper。h >是否按预期运行。然后试着找出你的麻烦项目和工作的普通项目有什么不同。

#2


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)

然后我才意识到所包含的文件似乎只在Windows 8.1 SDK(和未来的SDK来我想),在C:\Program Files (x86)\Windows包\ 8.1 \包括\嗯路径。医生没有提到这一点(所以你不需要Visual Studio 2013来使用它)

#3


3  

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

是的…右,VersionHelpers。h包含在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

对于那些使用VS2012的用户,您将不得不重新下载Win 8.1 SDK并安装它。导航到程序文件(x86)\Windows工具包\8.1\包括\。复制所有的文件并粘贴到8.0\包括\。最好跳过所有现有的文件。重载与

#1


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.

为了使用版本帮助宏,您需要将v120平台工具设置为VS 2013。如果您在VS 2013中创建了一个空项目,那么您将会发现其中包含了versionhelper。h工作正常。

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.

如果你的目标是v120,那么我想在你的项目中还有其他的错误配置。从一个全新的项目开始,并说服自己#包括< versionhelper。h >是否按预期运行。然后试着找出你的麻烦项目和工作的普通项目有什么不同。

#2


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)

然后我才意识到所包含的文件似乎只在Windows 8.1 SDK(和未来的SDK来我想),在C:\Program Files (x86)\Windows包\ 8.1 \包括\嗯路径。医生没有提到这一点(所以你不需要Visual Studio 2013来使用它)

#3


3  

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

是的…右,VersionHelpers。h包含在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

对于那些使用VS2012的用户,您将不得不重新下载Win 8.1 SDK并安装它。导航到程序文件(x86)\Windows工具包\8.1\包括\。复制所有的文件并粘贴到8.0\包括\。最好跳过所有现有的文件。重载与