Building Visual Leak Detector from Source

本文档详细介绍了如何从源代码构建Visual Leak Detector (VLD),包括安装所需的Debugging Tools for Windows和Platform SDK,以及如何配置Visual C++的搜索路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Building VisualLeakDetector from Source

Because VisualLeakDetector is open source, it can be built from source if you want to tweak it to your liking. The most difficult part about building VLD from source is getting your build environment correctly set up. But if you follow these instructions carefully, the process should be fairly painless.

  1. VLD depends on the Debug Help Library. This library is part ofDebugging Tools for Windows(DTfW). Download and install DTfW in order to install the required headers and libraries. I recommend installing version 6.5 of DTfW. Newer versions may also work, but older versions will probably not work. Be sure to manually select to install the SDK files during the DTfW installation or the headers and libraries will not be installed (they are not installed with a default installation).
  2. VisualC++ will need to be made aware of where it can find the Debug Help Library header and library files. Add thesdk\incandsdk\libsubdirectories from the DTfW installation directory to the include and library search paths in VisualC++. (See the section above onusing Visual Leak Detectoron instructions for adding to these search paths).
  3. VLD also requires a reasonably up-to-date PlatformSDK. It is known to work with the latest SDK (as of this writing) which is the Windows Server 2003 R2 SDK. It should also work with earlier SDKs, such as the Windows XP SP2 SDK or may even work with SDKs as old as the February 2003 SDK. If in doubt,update your PlatformSDKto the latest version.
  4. Again, VisualC++ will need to know where to find the PlatformSDK headers and libraries. Add theIncludeandLibsubdirectories from the PlatformSDK installation directory to the Include and Library search paths, respectively. The PlatformSDK directories should be placed just after the DTfW directories.

To summarize, your VisualC++ include search path should look something like this:

  • C:\ProgramFiles\DebuggingToolsforWindows\sdk\inc
  • C:\ProgramFiles\MicrosoftPlatformSDK\Include
  • C:\ProgramFiles\MicrosoftVisualStudio\VCx\Include
  • ...

And your VisualC++ library search path should look like this:

  • C:\ProgramFiles\DebuggingToolsforWindows\sdk\lib
  • C:\ProgramFiles\MicrosoftPlatformSDK\Lib
  • C:\ProgramFiles\MicrosoftVisualStudio\VCx\Lib
  • ...

In the above examples, "VCx" could be "VC", "VC7", or "VC98" (or possibly other values) depending on which version of Visual Studio you have installed. Also, the name of your PlatformSDK directory will probably be different from the example depending on which version of the PlatformSDK you have installed.

Once you have completed all of the above steps, your build environment should be ready. To build VLD, just open thevld.slnsolution file and do a full build.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值