简体   繁体   English

无法打开包含文件:'VersionHelpers.h':没有这样的文件或目录

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

I'm trying to use IsWindows7SP1OrGreater function, declared in VersionHelpers.h header. 我正在尝试使用在VersionHelpers.h标头中声明的IsWindows7SP1OrGreater函数。 And I get: 我得到:

'VersionHelpers.h': No such file or directory 'VersionHelpers.h':没有这样的文件或目录

although I can open this header from Visual Studio, it is found by syntax checker correctly. 虽然我可以从Visual Studio打开这个头,但是语法检查器可以正确找到它。 What's the problem? 有什么问题?

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. 为了使用版本助手宏,您需要定位VS 2013附带的v120平台工具集。如果在VS 2013中创建一个空项目,那么您会发现VersionHelpers.h的包含工作正常。

If you are targetting v120 then I guess something else is misconfigured in your project. 如果你的目标是v120那么我想你的项目中有其他错误的配置。 Start with a brand new project and convince yourself that #include <VersionHelpers.h> works as expected. 从一个全新的项目开始,并说服自己#include <VersionHelpers.h>按预期工作。 Then try to find out what's different between your troublesome project, and the plain vanilla project that works. 然后试着找出你麻烦的项目和有效的普通香草项目之间有什么不同。

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\u003c/code> path. 然后我才意识到该文件似乎只包含在Windows 8.1 SDK(以及我想来的未来SDK)中,位于C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um\u003c/code>路径中。 The doc doesn't mention that (so you don't need Visual Studio 2013 to be able to use it) 文档没有提到(所以你不需要Visual Studio 2013才能使用它)

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. 对于使用VS2012的用户,您必须重新下载Win 8.1 SDK并进行安装。 Navigate to the Program Files(x86)\\Windows Kits\\8.1\\Include\\um.\u003c/i> 导航到Program Files(x86)\\ Windows Kits \\ 8.1 \\ Include \\ um。 Copy all files and paste into 8.0\\Include\\um .\u003c/i> 复制所有文件并粘贴到8.0 \\ Include \\ um。 Its better to skip all existing files. 最好跳过所有现有文件。 Reload VS 重新加载VS.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法打开包含文件:&#39;ctype.h&#39;:没有这样的文件或目录 - Cannot open include file: 'ctype.h': No such file or directory 无法打开包含文件 - &#39;gtest.h&#39; - 没有这样的文件或目录 - Cannot open include file - 'gtest.h' - No such file or directory 无法打开包含文件:“unistd.h”:没有这样的文件或目录 - Cannot open include file: 'unistd.h': No such file or directory 无法打开包含文件:&#39;graphics.h&#39;:没有这样的文件或目录 - Cannot open include file: 'graphics.h': No such file or directory 无法打开包含文件:&#39;d3dx9.h&#39;:没有这样的文件或目录 - Cannot open include file: 'd3dx9.h': No such file or directory 无法打开包含文件“windows.h”没有这样的文件或目录 - Cannot open include file “windows.h” No such file or directory 无法打开包含文件:&#39;basewin.h&#39;:没有此类文件或目录 - Cannot open include file: 'basewin.h': No such file or directory 无法打开包含文件:“ sqlite3.h”:没有此类文件或目录 - Cannot open include file: 'sqlite3.h': No such file or directory 无法打开包含文件:&#39;jni.h&#39;:没有这样的文件或目录 - Cannot open include file: 'jni.h': No such file or directory 无法打开包含文件:&#39;ntddk.h&#39;:没有这样的文件或目录 - Cannot open include file: 'ntddk.h': No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM