11

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:

        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. 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.

Community
  • 1
  • 1
Epaga
  • 35,261
  • 53
  • 143
  • 239
  • Possible duplicate of [Visual Studio 2017 can't find windows.h](https://stackoverflow.com/questions/43410631/visual-studio-2017-cant-find-windows-h) – Stevoisiak Jul 06 '18 at 15:19

2 Answers2

9

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.

Epaga
  • 35,261
  • 53
  • 143
  • 239
  • 2
    So, you have to set the value of the "Include" path variable to "C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include". If it did not exist you created the "Include" environment variable and set the value to that specified in your answer? – krex Dec 11 '14 at 12:40
  • 2
    I'm genuinely asking and also think for prosperity that it is worth being explicit here. – krex Dec 11 '14 at 12:41
  • 1
    @JohnDoe - just tried it, some of the Windows SDK's have build command prompts, if you open one and [type `SET`](http://stackoverflow.com/questions/5327495/list-all-environment-variables-from-command-line), you will see all environment variables, among others `Include=`... which is verbatim as such. – sdaau May 31 '16 at 17:36
1

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

abatishchev
  • 92,232
  • 78
  • 284
  • 421