简体   繁体   English

由于无法打开Windows.h,因此无法建立Heob

[英]Cannot build heob because windows.h cannot be opened

I'm trying to use heob ( source code ), which is an open source program for detecting memory leaks in Qt Creator. 我正在尝试使用heob源代码 ),这是一个用于检测Qt Creator中内存泄漏的开源程序。

I've downloaded the source code and am trying to build the project using build.bat , a file they give to build the project. 我已经下载了源代码,并试图使用build.bat来构建项目, build.bat是他们提供的用于构建项目的文件。

However, I'm getting the following error: 但是,出现以下错误:

heob-ver.rc(2) : fatal error RC1015: cannot open include file 'windows.h'. heob-ver.rc(2):致命错误RC1015:无法打开包含文件“ windows.h”。

I have the latest Windows 10 SDK and the proper paths in my environment variables. 我在环境变量中拥有最新的Windows 10 SDK和正确的路径。 I'm pretty sure heob uses rc.exe to build the project. 我很确定heob使用rc.exe来构建项目。 I also have the path to rc.exe in my PATH variable as well. 我的PATH变量中也有rc.exePATH

I originally thought it was a permissions thing, but I ran the command prompt as an administrator and it still did not build. 我原本以为这是权限问题,但我以管理员身份运行命令提示符,但仍未构建。 From what I can gather, it can find windows.h but not open it. 据我所知,它可以找到windows.h但无法打开它。

Does anyone have experince with heob and can point me in the right direction? 有没有人有过使用heob的经验,可以指出正确的方向吗? Has anyone experienced anything similar? 有没有人经历过类似的经历?

For some reason heob could not find any files in the Windows SDK. 由于某些原因,heob在Windows SDK中找不到任何文件。 I copied and pasted all of the necessary .h files from the Windows SDK directory into the heob directory (where build.bat is located) and the error went away. 我将所有必需的.h文件从Windows SDK目录复制并粘贴到heob目录(build.bat所在的目录)中,错误消失了。 This is not the best solution, but it works for my purposes. 这不是最好的解决方案,但可以满足我的目的。 If someone can tell me a better way, I'd love to hear about it! 如果有人可以告诉我更好的方法,我很想听听!

EDIT: 编辑:

The best way to do this was to run build.bat on the Visual Studio command prompt (VS 2015 x64 Native Tools command prompt, to be specific) instead of the Windows command prompt. 最好的方法是在Visual Studio命令提示符(具体来说是VS 2015 x64 Native Tools命令提示符)而不是Windows命令提示符下运行build.bat。 I did not have to copy and paste anything. 我不必复制和粘贴任何内容。

After a little more research, it is because VS handles a lot of the dependencies that Windows does not. 经过更多研究后,这是因为VS处理了Windows无法处理的许多依赖项。 For some reason it seams build.bat's defaulting to the Windows command prompt. 由于某种原因,它会将build.bat的默认设置接缝到Windows命令提示符。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM