位置: IT常识 - 正文

Using Visual Leak Detector

编辑:rootadmin
Visual Leak Detector for Visual C++ 2008/2010/2012Using Visual Leak DetectorThis section briefly des Using Visual Leak Detector

推荐整理分享Using Visual Leak Detector,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

This section briefly describes the basics of using Visual Leak Detector (VLD).

Important! : Before using VLD with any Visual C++ project, you must first add the Visual Leak Detector include and library directories to the Visual C++ include and library directory search paths:For all compiler versions take care to ensure that no junk characters get added when you add the include and library paths. If you browse to the "Program Files(x86) folder using the dialog box provided by Visual Studio and select it you could end up seeing the "%" replacing the "(".

And remember to close and open the Visual Studio IDE once you have modified the default include and library paths which the compiler and linker would always look at.

Visual C++ 2010: Go to View ->Property Manager, select Microsoft.Cpp.Win32.user. Select VC++ Directories and then "Include files" from the tree. Add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select "Library files" from the drop-down menu and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Repeat for Microsoft.Cpp.x64.user, but select lib\Win64 subdirectory instead.Visual C++ 2005 and 2008: Go to Tools -> Options -> Projects and Solutions -> VC++ Directories. Select "Include files" from the "Show Directories For" drop-down menu. Add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select "Library files" from the drop-down menu and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Visual C++ 2003: Go to Project Properties -> C/C++ -> General -> Additional Include Directories and add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select Additional Library Directories and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Visual C++ 6: Go to Tools -> Options -> Directories. Select "Include files" from the "Show Directories For" drop-down menu. Add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select "Library files" from the drop-down menu and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Using Visual Leak Detector

To use VLD with your project, follow these simple steps:

In at least one C/C++ source file from your program, include the vld.h header file. It should not matter which file you add the include statement to. It also should not matter in what order the header is included in relation to other headers. The only exception is stdafx.h (or any other precompiled header). A precompiled header, such as stdafx.h, must always be the first header included in a source file, so vld.h must be included after any precompiled headers. If your program contains one or more DLLs that you would also like to check for memory leaks, then also include vld.h in at least one source file from each DLL to be included in leak detection. Build the debug version of your program.

Note: Unlike earlier (pre-1.9) versions of VLD, it is now acceptable to include vld.h in every source file, or to include it in a common header that is included by many or all source files. Only one copy of the VLD code will be loaded into the process, regardless of how many source files include vld.h.

VLD will detect memory leaks in your program whenever you run the debug version. When you run the program under the Visual C++ debugger, a report of all the memory leaks detected will be displayed in the debugger's output window when your program exits (the report can optionally be saved to a file instead, see ReportFile under Configuration Options). Double-clicking on a source file's line number in the memory leak report will take you to that file and line in the editor window, allowing easy navigation of the code path leading up to the allocation that resulted in the memory leak.

Note: When you build release versions of your program, VLD will not be linked into the executable. So it is safe to leave vld.h included in your source files when doing release builds. Doing so will not result in any performance degradation or any other undesirable overhead.

Last edited Oct 29 2011 at 5:18 PM by pramis, version 5

Note: Unlike earlier (pre-1.9) versions of VLD, it is now acceptable to include vld.h in every source file, or to include it in a common header that is included by many or all source files. Only one copy of the VLD code will be loaded into the process, regardless of how many source files include vld.h.Note: When you build release versions of your program, VLD will not be linked into the executable. So it is safe to leave vld.h included in your source files when doing release builds. Doing so will not result in any performance degradation or any other undesirable overhead.

本文链接地址:https://www.jiuchutong.com/zhishi/303683.html 转载请保留说明!

上一篇:最强MacBook苹果笔记本macos电脑应用Sublime Text 4代码编辑器傻瓜汉化教程(哪一款macbook)

下一篇:CSS设置背景图片不显示的解决方法(css设置背景图片填充)

  • 居民个人取得境内、境外所得,如何计算应纳税额?
  • 劳务发票要交多少税费
  • 外籍人员可以在中国工作吗
  • 出口货物退免税管理办法
  • 三证合一后税务登记办理流程
  • 固定资产报废电脑
  • 小规模纳税人差额征收税率是多少
  • 核定征收的收入总额包括营业外收入吗
  • 生产型增值税转变为消费型增值税
  • 纸质发票如何查看电子发票
  • 房地产企业土地增值税清算
  • 售后回租涉税
  • 房地产计税毛利率什么意思
  • 支付微信收款放在哪里
  • 3%增值税率包括哪些
  • 住宿费的普通发票怎么开
  • 建筑业企业包括哪些企业
  • 企业所得税申报表在哪里打印
  • 制造费用月末需要结转吗
  • 委托出口业务的账务如何处理呢?
  • 小规模纳税人增值税申报表怎么填
  • win10文件用什么打开
  • psbcie.exe是什么
  • 债务利率的公式
  • 局域网游戏电脑
  • 圣海伦斯山国家火山纪念区
  • 债务重组 收益
  • dxva2.dll是什么意思
  • vue引入echarts柱状图
  • 发财树怎么养护与浇水
  • ecap.exe是什么意思
  • 被雪覆盖的山峰
  • 应付未付工资企业所得税
  • 股东分红个人所得税怎么算
  • 特许权使用费的增值税税率是多少
  • nginx反向代理未知域名
  • 可供出售交易资产
  • 莫斯塔尔古桥多高
  • 招待费专票可以抵扣进项吗
  • 自己买材料自己装修
  • 小微企业延缓缴纳
  • 逻辑回归模型
  • node .js
  • 云原生istio
  • vue中的路由守卫有哪些
  • 销售旧货怎么填写申报表
  • 物流公司主营业务怎么写
  • 分公司开票总公司付款可以吗
  • mongodb主从复制和副本集架构有什么联系和区别
  • 专项附加扣除中住房租金扣除所指的工作城市范围包括
  • 投资性房地产由成本模式转为公允价值模式
  • 主营业务成本结转本年利润会计分录
  • 摄影属于哪种服务业
  • 应收应付票据包括什么
  • 归还股东投资款本息怎么做账
  • mysql重置
  • 坏账准备的会计处理方法
  • 港币转人民币差多少钱
  • 当月没有凭证还能报税吗
  • 收到一张发票摘要怎么填
  • 支付设备款怎么做账
  • 结转主营业务成本是什么意思
  • 存货跌价准备可以转回吗,分录怎么写
  • 职工福利费核算哪些内容
  • mysql5.7免安装版
  • ubuntu 添加开机启动
  • win7如何创建文件夹
  • linux修改用户名
  • win7自带防火墙关闭后自己打开啥原因
  • npscheck.exe - npscheck是什么进程 有什么用
  • win8.1系统升级win10
  • 在linux系统中拥有
  • linux c程序开发
  • node.js web
  • javascript的
  • 不动产租赁和经营租赁发票的区别
  • 如何退契税网上申请
  • 增值税专用发票提高限额
  • 江苏盐在什么地方
  • 税务局窗口人员工作内容
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设