Windows中通过cl编译.cpp文件生成exe

VS2005的默认安装路径:C:\Program Files\Microsoft Visual Studio 8

1.将"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE"下面的几个文件:
mspdbsrv.exe
msobj80.dll
mspdb80.dll
mspdbcore.dll
拷贝到“C:\Program Files\Microsoft Visual Studio 8\VC\bin”目录下。
不然会出现“mspdb80.dll无法找到”错误。

2.批处理编译脚本如下:
set PATH=C:\Program Files\Microsoft Visual Studio 8\vc\bin
set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include;C:\Program Files\Microsoft Visual Studio 8\VC\include
set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib;C:\Program Files\Microsoft Visual Studio 8\VC\lib

set SOURCE_PATH=C:\Visual Studio 2005\Projects\StructSize\StructSize
cl "%SOURCE_PATH%\*.cpp"


你可能感兴趣的:(c,windows,脚本)