位置: 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设置背景图片填充)

  • 讲课费怎么代扣代缴个人所得税
  • 购进货物用于建造厂房可以抵扣增值税吗
  • 公司成立之初做哪些
  • 投资款转账没备案怎么办
  • 土地增值税二次清算规定
  • 政府发放的人才补贴,企业可以增加条款要求离职返还吗
  • 国家税务定额发票票样
  • 社保缴费基数什么意思
  • 对公账户转个人账户
  • 资产总额全年季度平均值怎么填写
  • 视同销售计入销售费用能税前扣除吗
  • 赔偿金要交增值税吗
  • 维修费增值税
  • 2016年172号
  • 公司工会有税号吗
  • 展览费怎么开票
  • 员工入职体检表格模板
  • 出口加工区内企业不能从事的业务有
  • 企业销售食品过期处罚
  • 未认证的进项税账务处理
  • php生成唯一标识
  • u盘win10系统安装教程
  • 工程审计需要什么条件
  • win10电源高性能被删了
  • root面具怎么用
  • 辞退补偿款怎么算
  • 资产负债表左方烈士的资产按什么排列
  • linux安装配置ftp
  • 设备租赁的方式有哪些
  • 外经交的个税如何计算
  • 通行费发票认证怎么操作
  • 非成品柴油用途
  • 一只什么海鸥填空
  • 社保基数跟个税差1仟多有风险吗
  • semeion手写数据集
  • 增值税减免附加税用计提吗
  • 车间打杂工
  • 普票3个点可以抵扣吗
  • 认缴制对实务操作的可能影响有哪些?
  • 退社保基金怎么办理
  • mysql union or
  • 一个例子解释唯物辩证法三大规律
  • 收到增值税收入423300,款项已存入国库
  • 企业工作小结
  • 业务招待费计入其他业务成本
  • mysql改造
  • 存货增加使经营活动现金净流量减少该怎么办
  • 公司发放加班补贴怎么做账
  • 其他应付款做账
  • 发票还没认证可以报销吗
  • 对外服务应收取的款项
  • 小企业汇算清缴补税会计分录
  • 超期应收款管控
  • 购房增值税发票是购房发票吗
  • 开具红字发票的当月就要进项税额转出吗?
  • 测绘费计入什么明细科目
  • 工会经费计入科目
  • 固定资产转让开票大类是什么
  • 开发票的其他要求是?
  • 会计各种凭证的填写示例
  • xp系统玩英雄联盟出现win32
  • Win7系统开机流程
  • window照片无法预览
  • 资源管理器 windows
  • win10系统小娜不见了
  • ubuntu搭建hexo
  • 电脑系统垃圾
  • win7的系统设置
  • opengl示例
  • linux命令sed的用法
  • unity怎么替换模型位置
  • JavaScript中Number.MIN_VALUE属性的使用示例
  • python灰度变换
  • 手把手教你把币从交易所提到钱包
  • 手机android版本强制升级
  • dom操作的方法有哪些
  • js中类
  • 天津生育津贴如何查询申请进度
  • 重庆市低保查询电话
  • 印花税为什么不计入资产成本
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设