vc调试时使用vld(visual leak detector)出错的解决方法

参考:

http://www.codeproject.com/KB/applications/visualleakdetector.aspx

http://www.ltesting.net/AutoTest/Opentest/200609/896.htm

vld是一个windows下的免费的内存泄露检测工具,可以和vc配合使用,支持vc2005、vc2008,目前的版本是1.9h(beta)版(推荐使用这个版本)

在vista下使用vld的使用,总是出现错误无法正常工作,后来经过搜索,在http://www.codeproject.com/KB/applications/visualleakdetector.aspx

上的评论中找到了解决的方法:

评论“Solution for running 1.9 beta on Visual Studio 2008 with Vista ”给出了解决方法:

评论1:
VLD kept crashing when trying to use 1.9g beta on Windows Vista, visual studio 2008. I tried all the suggestions on here and nothing worked. But I finally figured it out.

when you make a project in visual C++ 2008, it sets some strange advanced Linker properties that cause VLD to crash:

I changed Linker->Advanced->Randomized Base Address from Enable Image Randomization (/DYNAMICBASE) to Disable Image Randomization (/DYNAMICBASE:NO)

Then I changed Linker->Advanced->Data Execution Prevention from Image is compatible with DEP (/NXCOMPAT) to Default

And now it works perfectly

Please let me know if this helped you! It'll make me feel better for spending a whole day trying to get it working!
-Nadav

评论2:
The base address randomization seems to be not necessary. Just disable DEP.

大致的意思是说,只需要禁用DEP即可,
在工程的“属性”->“链接器”->“高级”->数据执行保护(DEP),设为“默认”(default)或者“映像与 DEP 不兼容(/NXCOMPAT:NO) “ 即可


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值