Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

c++ - Error "fatal error C1034: windows.h: no include path set"

OS Windows Vista Ultimate

I am trying to run a program called minimal.c. When I type at the command line:

C:Users
athanDesktop>cl minimal.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86

Copyright (C) Microsoft Corporation.  All rights reserved.

minimal.c
minimal.c(5) : fatal error C1034: windows.h: no include path set

I have set all the paths:

C:Users
athanDesktop>path
PATH=C:Program Files (x86)Microsoft Visual Studio 8VCin;C:Windowssystem3
;C:Windows;C:WindowsSystem32Wbem;C:Program Files (x86)ATI TechnologiesAT
.ACECore-Static;C:Program FilesIntelDMIX;c:Program Files (x86)Microsoft S
L Server100ToolsBinn;c:Program Files (x86)Microsoft SQL Server100DTSBi
n;C:Program Files (x86)QuickTimeQTSystem;C:Program Files (x86)Javajdk1.
.0_13in;C:Program Files (x86)AutodeskBackburner;C:Program Files (x86)Co
mon FilesAutodesk Shared;C:Program Files (x86)Microsoft DirectX SDK (March
009)Include;C:Users
athanDesktopglut-3.7.6-binglut-3.7.6-bin;C:Program F
les (x86)Microsoft Visual Studio 8Common7IDE;C:Program Files (x86)Microsof
 Visual Studio 8VCPlatformSDKInclude;C:Program Files (x86)Microsoft Visual
Studio 8VCPlatformSDKIncludegl

I have gone and made sure windows.h is in the directory. I'm setting the path too. It's in C:Program Files (x86)Microsoft Visual Studio 8VCPlatformSDKInclude.

I have Visual?Studio?2005.

I have exhausted all possibilities. Any ideas?

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

You could also run the vcvars32.bat file from the directory C:Program FilesMicrosoft Visual Studio 8VCin (this is in your path) prior to your cl command.

Like this:

C:Users
athanDesktop>vcvars32
C:Users
athanDesktop>cl minimal.c

vcvars32 calls C:Program FilesMicrosoft Visual Studio 8Common7Toolsvsvars32.bat which sets up the required environment for compiling and linking.

The environment variables are INCLUDE, LIB, and PATH.

The compiler looks for header files in the INCLUDE path during compile, and libraries are fetched from the LIB path during link.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...