C++代码静态分析工具-Prefast

Prefast是一种代码分析工具,它能够帮助你找到编译器不能找到的错误或者缺陷。Prefast首次被微软集成到Visual Studio 2005 Team Suite中去,使用起来非常方便

vc6中使用Prefast的方法:

prefast是附带在微软的DDK中的

In VC6 project

1. Install Windows IFS Kit and DDK package
2. Execute Development Kits->Windows IFS Kit and DDK ->Build environment -> windows 2000->windows 2000 checked build environment
3. Export Visual Studio project to a .mak file
4. remove /GZ in .mak file or link fail
5. Edit a run.bat file (not necessary, only for set new include and lib path)

run.bat file content
----------------
rem set include and lib path
set include=C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include
set lib=C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib
rem clean environment
nmake /f httpgetfile.mak clean
rem run prefast command
C:\WINDDK\3790.1830\bin\x86\prefast\scripts\prefast nmake /f httpgetfile.mak CFG="HttpGetFile - Win32 Debug"
rem unset include and lib path
set lib=
set include=

posted on 2007-04-30 23:13  cy163  阅读(...)  评论(...编辑  收藏

导航