f



fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

Why is building via command line in VC++ 2005 is so difficult?

My project builds fine from within the IDE.

However, when I attempt to build it from the command line:

vcbuild myproj.sln "Debug|Win32"

I get the following error:

fatal error C1083: Cannot open include file: 'windows.h': No such file
or directory

Now... I know about the INCLUDE env var, installing the PSDK etc. In
fact, I verified that windows.h is alive and kicking in:

C:\Program Files\Microsoft Platform SDK for Windows Server 2003
R2\Include

And checked the env var:

C:\Program Files\Microsoft Visual Studio 8\VC>echo %INCLUDE%

C:\Program Files\Microsoft Platform SDK for Windows Server 2003
R2\Include;C:\Program Files\Microsoft Platform SDK for Windows Server
2003 R2\Include\mfc;C:\Program Files\Microsoft Visual Studio 8\VC
\INCLUDE;

And I have no clue why on earth why such a nasty error occur.

Can someone please help?

Thanks,
Victor

0
vc6
3/29/2007 9:24:48 PM
comp.os.programmer.win32 14523 articles. 0 followers. Post Follow

3 Replies
1303 Views

Similar Articles

[PageSpeed] 15

vc6 schrieb:
> Why is building via command line in VC++ 2005 is so difficult?
> 
> My project builds fine from within the IDE.
> 
> However, when I attempt to build it from the command line:
> 
> vcbuild myproj.sln "Debug|Win32"
> 
> I get the following error:
> 
> fatal error C1083: Cannot open include file: 'windows.h': No such file
> or directory
> 
> Now... I know about the INCLUDE env var[...]

Try the option /useenv.

See here:
http://msdn2.microsoft.com/en-us/library/cz553aa1(VS.80).aspx

-- 
Thomas
http://www.netmeister.org/news/learn2quote.html
0
Thomas
3/29/2007 11:41:00 PM
On Mar 30, 7:24 am, "vc6" <v...@ausi.com> wrote:

> Why is building via command line in VC++ 2005 is so difficult?

I too have noticed the newer versions of VC++ seem to have
made this process a little more difficult than usual when
compared to the earlier VC++ releases.

> I get the following error:
>
> fatal error C1083: Cannot open include file: 'windows.h': No such
> file or directory
>
> Now... I know about the INCLUDE env var, installing the PSDK etc. In
> fact, I verified that windows.h is alive and kicking in:

I found that to get the compiler to work putting install directories
into the path is no longer enough.

With these later version of the VC++ compiler you really have to
use the VCVARS32.BAT to setup the environment.

Naturally it should be possible to transfer the VCVARS32.BAT details
into the environment but I found these newer batch files are far more
complex than the older batch files, so it is easier to just use the
batch file as is.

> Can someone please help?

Here is what I did to get it to work:

   http://www.zeusedit.com/forum/viewtopic.php?t=1045

Jussi Jumppanen
http://www.zeusedit.com - Zeus for Windows Programmer's IDE

0
JussiJ
3/30/2007 1:22:25 AM
On Mar 29, 6:41 pm, "Thomas J. Gritzan" <Phygon_ANTIS...@gmx.de>
wrote:
>
> Try the option /useenv.
>

My God - You are a genius! This is exactly what I was missing. Thank
you, Thank you, Thank you!

Of course I was using VCVARS32.BAT, but how on earth was I supposed to
know that this is not enough? What is Microsoft's rational to require
an explicit switch to use the environment variables? Isn't that
obvious? This is really weird - especially considering the fact that
the aforementioned INCLUDE path was included in the .vcproj as well.
This is beyond me.

Thanks again,
Victor

0
vc6
3/30/2007 3:43:57 AM
Reply: