Windows NT Systems Programming: Spring 1999

[ Home | Syllabus | Course Notes | Assignments | Search]


 

Using the visual c compiler in console mode

Before using the visual c++ compiler in console mode, you need to set certain environment variables. The way you do this depends on which operating system you use. I have variously put a call to ..vc/bin/vcvars32.bat in autoexec.bat, changed the environment variables in windows NT using the control panel/system mode or installed vcvar32.bat in the startup directory. Below is from the V++ help file about this.

 

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.

<Picture>To run VCVARS32.BAT



1.At the command prompt, change to the \bin subdirectory of your Visual C++ installation.2.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.

See Also   CL Environment Variable, LINK Environment Variables, Using Environment Variables