Tech Support > Microsoft Windows > Development Resources > fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Posted by vc6 on March 29th, 2007


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

Posted by Thomas J. Gritzan on March 29th, 2007


vc6 schrieb:
Try the option /useenv.

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

--
Thomas
http://www.netmeister.org/news/learn2quote.html

Posted by JussiJ on March 30th, 2007


On Mar 30, 7:24 am, "vc6" <v...@ausi.com> wrote:

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

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


Posted by vc6 on March 30th, 2007


On Mar 29, 6:41 pm, "Thomas J. Gritzan" <Phygon_ANTIS...@gmx.de>
wrote:
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



Similar Posts