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:

When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error:


               [cl] Compiling 2 files to C:\ikvm-\native\Release'.

               [cl] jni.c
               [cl] os.c
               [cl] C:\ikvm-\native\os.c(25) : fatal error C1083: Cannot open include file: 'windows.h': No such
                    file or directory
               [cl] Generating Code...


        External Program Failed: cl (return code was 2)

I have the Platform SDK installed. 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. Edit #2 Found the answer (see my answer below): The directory containing windows.h needed to be in the "Include" path variable.

5/23/2017 12:09:26 PM

Accepted Answer

OK here is the answer I ended up finding: rather than being on the Path, the directory with windows.h (in my case, C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include) needed to be set in the Include environment variable.

9/17/2008 8:48:49 AM

By the way, create environment variable %LIB%, meaning the same - path to all SDKs lib directories

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow