View Full Version : msvc++ problem

11-18-2001, 06:34 AM
I have a problem with msvc++. I need to be able to use the command line in order to compile allegro. I’ve written a simple hello world program and it compiles fine with djgpp. But it doesn’t work with msvc++(command line). when I type “cl hello.c” I get an error: "fatal error c1034: stdio.h: no include path set". I assume there is a difference for setting the include path in the GUI and the command line. how do I set the include path for msvc in the command line. Can it be done with environment variables?

11-18-2001, 10:16 AM
From MSDN:

Set Environment Variables
Home | Overview | Details

CL.EXE, LINK.EXE, and other command-line tools require that certain environment variables be set properly. These include PATH, which must point to the \bin subdirectory of your Visual C++ installation, LIB, which must point to \lib, and INCLUDE, which must point to \include.

When you install Visual C++, setup creates a batch file, VCVARS32.BAT, containing commands to modify the PATH, LIB, and INCLUDE environment variables. If these variables haven't been set properly, run VCVARS32.BAT before you compile at the command prompt. VCVARS32.BAT is located in the \bin subdirectory. Note that you do not need to run VCVARS32.BAT if you are compiling your program inside the development environment.


At the command prompt, change to the \bin subdirectory of your Visual C++ installation.

Run VCVARS32.BAT by typing VCVARS32.
Note VCVARS32.BAT may vary from machine to machine. You should not copy a missing or damaged VCVARS32.BAT file from another installation.

11-18-2001, 12:58 PM
Thanks Fordy.

I added two variables. But my hello program still wouldn't compile. I got an other error. something about a linker.
But I tried compileing allegro and it worked. I had an error during compilation but that is due to win2k(they said at allegro.cc) so it looks like it worked. still wandering why a complex program as allegro would compile and my very simple hello program not. oh well, life is full of strange things:D. But thanks again Fordy it really helped.