Set Environment Variables

OverviewDetails

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.

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