執行 VC 環境變數批次檔

當使用命令列(Command line)的方式來編譯程式時,必須先設定VC的環境變數。

1.    在「執行」,輸入「cmd」

2.    接著輸入「 "C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32"

Note1:
    vsvars32.bat 檔會設定適當的環境變數以啟用命令列建置

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

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.

Note 3:
    -    當您執行 Vcvars32.bat 批次檔會收到 " Out of 環境空間 」 錯誤訊息
    -    Out of MS - DOS 程式中環境空間錯誤訊息
 

Hosted by www.Geocities.ws

1