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

  • 工程项目纳税
  • 主营业务税金及附加怎么算
  • 被告承担诉讼费用
  • 免税进口的自用设备再销售时该怎么征税
  • 通过应交税费核算的
  • 公司购买软件著作权
  • 怎样冲回多计提的费用
  • 银行贷款损失的认定标准
  • 哪些支出可计入成本
  • 进项票不足
  • 增值税专用发票和普通发票的区别
  • 主营业务税金及附加包括印花税吗
  • 增值税发票作废有什么损失
  • 所得税为负值是什么意思
  • 地方教育费附加减免政策
  • 公司购房、售房需要缴纳哪些税?
  • 年数总和折旧计算方法
  • 增值税附表一免税项目金额填不上
  • 购方收到红字发票怎么办
  • 减少注册资本金程序
  • 购买商品用于赠送
  • 销项税额抵减会取得专用发票吗为什么
  • 收到工伤保险的发票
  • 减免税款未抵扣增值税
  • 终于找到修改mac的方法了!
  • win 11 中文
  • unsupportedfirsthd解决办法
  • 自用房地产转换为采用公允价值
  • win10任务栏怎么隐藏
  • 公司过年买的鞭炮可以入账吗
  • 电脑qq聊天框变成一侧显示的软件版本
  • 如何免费获得microsoft
  • 对违规送礼行为怎么处理
  • 什么是集成显卡长什么样
  • php图形用户界面
  • 如何通过手机号码查对方在哪里
  • 库存股会计处理 会计视野
  • vue3中props
  • php控制结构
  • yolo系列算法全家桶
  • html用语
  • 购买货物对方代付怎么办
  • 待摊费用在资产负债表里写在哪
  • 什么是行政规费和税费
  • 教育费附加减免政策
  • 生产车间领用材料的会计分录
  • 公司垫付的工伤医药费怎么报销
  • 合同资产科目包含增值税吗
  • 财务报表的组成主要包括
  • 营销策划协议
  • 餐饮服务需要卫生许可证吗
  • sql语句取并集
  • 企业残障金缴纳标准
  • 用商品抵债的分类有哪些
  • 个人独资企业需要缴纳哪些税种
  • 为什么购买办公用品
  • 应税服务零税率是什么
  • 申请专利的费用怎么入账
  • 利息收入如何开票
  • 原材料用于在建工程进项税可以抵扣吗
  • 售后更换零件的申请
  • 预付账款科目的余额如果在借方,则在资产负债表上
  • 物业公司代收代缴水电费
  • 劳务派遣税率是多少2023
  • 固定资产可以一次性入费用的标准
  • 《新会计准则》
  • 互联网代记账业务
  • 数据库访问机制
  • sql you
  • hptasks.exe是病毒吗 是什么进程 hptasks进程说明
  • centos7ssh登录
  • WIN10系统中软件打开找不到网络共享盘
  • hosts文件win10
  • shell根据时间获取文件
  • css布局的经典网站
  • opengl learn
  • python生成随机数表
  • javascript基础教程教材答案
  • 用原生js实现过什么功能
  • 非中山户籍学生可以自己买医保吗
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设