Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
595 views
in Technique[技术] by (71.8m points)

c# - 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:

        ikvm-native-win32:

               [cl] Compiling 2 files to C:ikvm-0.36.0.11
ativeRelease'.

               [cl] jni.c
               [cl] os.c
               [cl] C:ikvm-0.36.0.11
ativeos.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
ative
ative.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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 FilesMicrosoft SDKsWindowsv6.0AInclude) needed to be set in the Include environment variable.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...