views:

1745

answers:

3

OS Windows Vista Ultimate

trying to run a program called minimal.c when i type at command line

C:\Users\nathan\Desktop>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\nathan\Desktop>path
PATH=C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin;C:\Windows\system3
;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\ATI Technologies\AT
.ACE\Core-Static;C:\Program Files\Intel\DMIX;c:\Program Files (x86)\Microsoft S
L Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Bi
n\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Java\jdk1.
.0_13\bin;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files (x86)\Co
mon Files\Autodesk Shared\;C:\Program Files (x86)\Microsoft DirectX SDK (March
009)\Include;C:\Users\nathan\Desktop\glut-3.7.6-bin\glut-3.7.6-bin;C:\Program F
les (x86)\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files (x86)\Microsof
 Visual Studio 8\VC\PlatformSDK\Include;C:\Program Files (x86)\Microsoft Visual
Studio 8\VC\PlatformSDK\Include\gl

i have gone and made sure windows.h is in the directory im setting the path too. its in C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Include.

i have visual studio 2005

i have exhausted all possiblies any ideas

+2  A: 

When you started the command line, did you run the included command line shortcut that comes with the Visual Studio setup? This will set the correct environment variables for you so that the compilation will work correctly.

1800 INFORMATION
+6  A: 

You could also run the vcvars32.bat file from the directory C:\Program Files\Microsoft Visual Studio 8\VC\bin (this is in your path) prior to your cl command.
Like this:

C:\Users\nathan\Desktop>vcvars32
C:\Users\nathan\Desktop>cl minimal.c

vcvars32 calls C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat which sets up the required environment for compiling and linkng.
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.

Kb
i ran vcvars32 as you said and the windows.h is not a problem anymore. i dont understand that if i have the path in environment variables why it didnt work unless i run that. Do i have to run that everytime i open a commandline prior to compiling...it also wants to know where Gl.h is which is included in my path as well but its not finding it.C:\Program Files (x86)\Microsoft VisualStudio 8\VC\PlatformSDK\Include\gl
ps thanks KB, 1800 information and sean e for jumping on this so quickly. you guys rock!!!!!!
+2  A: 

You've added your INCLUDE paths to your PATH environment variable. Use vcvars32.bat as the others have suggested.

sean e