下载:
-2.0b
安装:
下一步下一步即可
使用:
在代码里加入#include , 把vld下的include和lib文件夹加入到工程中, 编译debug版本,
会提示错误如下:
3>C:\Program Files (x86)\Visual Leak Detector\include\vld.h(122): error C2065: 'HMODULE' : undeclared identifier
3>C:\Program Files (x86)\Visual Leak Detector\include\vld.h(122): error C2182: 'VLDEnableModule' : illegal use of type 'void'
3>C:\Program
Files (x86)\Visual Leak Detector\include\vld.h(122): error C2491:
'VLDEnableModule' : definition of dllimport data not allowed
3>C:\Program Files (x86)\Visual Leak Detector\include\vld.h(131): error C2065: 'HMODULE' : undeclared identifier
3>C:\Program
Files (x86)\Visual Leak Detector\include\vld.h(131): error C2182:
'VLDDisableModule' : illegal use of type 'void'
3>C:\Program Files
(x86)\Visual Leak Detector\include\vld.h(131): error C2491:
'VLDDisableModule' : definition of dllimport data not allowed
3>C:\Program Files (x86)\Visual Leak Detector\include\vld.h(146): error C2065: 'UINT32' : undeclared identifier
3>C:\Program
Files (x86)\Visual Leak Detector\include\vld.h(146): error C2146:
syntax error : missing ')' before identifier 'option_mask'
3>C:\Program
Files (x86)\Visual Leak Detector\include\vld.h(146): error C2182:
'VLDSetReportOptions' : illegal use of type 'void'
3>C:\Program
Files (x86)\Visual Leak Detector\include\vld.h(146): error C2491:
'VLDSetReportOptions' : definition of dllimport data not allowed
3>C:\Program Files (x86)\Visual Leak Detector\include\vld.h(146): error C2059: syntax error : ')'
, 这是2.0b的一个bug, 修复方法是修改vld.h的开头部分, 改成内容如下:
#if !defined(_68K_) && !defined(_MPPC_) &&
!defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_)
&& defined(_M_IX86)
#define _X86_
#endif
#include
#include "vld_def.h"
#ifdef _DEBUG
#pragma comment(lib, "vld.lib")
再编译就ok了.
开始debug, 在程序退出后, 如果有内存泄露, vld会在调试输出窗口打印出内存泄露的位置和大小, 剩下的工作就是仔细检查源代码了.
阅读(5088) | 评论(0) | 转发(0) |