简体   繁体   English

致命错误C1083 - 无法打开包含文件:“windows.h”:没有这样的文件或目录

[英]Fatal Error C1083 - Cannot open include file: “windows.h”: No such file or directory

I'm trying to get IKVM to build (see this question ) but now have encountered a problem not having to do with IKVM so I'm opening up a new question: 我正在尝试让IKVM构建(请参阅此问题 ),但现在遇到了与IKVM无关的问题,因此我打开了一个新问题:

When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error: 使用Visual Studio 2008命令提示符(从“开始”菜单)在IKVM目录上运行nant时,出现以下错误:

  ikvm-native-win32: [cl] Compiling 2 files to C:\\ikvm-0.36.0.11\\native\\Release'. [cl] jni.c [cl] os.c [cl] C:\\ikvm-0.36.0.11\\native\\os.c(25) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory [cl] Generating Code... BUILD FAILED C:\\ikvm-0.36.0.11\\native\\native.build(17,10): External Program Failed: cl (return code was 2) 

I have the Platform SDK installed. 我安装了Platform SDK。 What am I missing? 我错过了什么? I'm sure it's something simple... 我确定这很简单......

Edit #1 I just checked - I do have the directory containing windows.h on the Path. 编辑#1我刚刚检查过 - 我在路径上有包含windows.h的目录。 Edit #2 Found the answer (see my answer below): The directory containing windows.h needed to be in the "Include" path variable. 编辑#2找到答案(参见下面的答案):包含windows.h的目录需要在“Include”路径变量中。

好的,这里是我最终找到的答案:而不是在路径上,需要设置带有windows.h的目录(在我的例子中,C:\\ Program Files \\ Microsoft SDKs \\ Windows \\ v6.0A \\ Include)包含环境变量。

顺便说一句,创建环境变量%LIB%,意思相同 - 所有SDK lib目录的路径

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

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