我在带有Visual Studio 2010的Win32项目中包括了vld.h,vld.lib和vld_x86.dll。它可以正确构建,但是当我执行时,它崩溃并显示以下消息:
"The application was unable to start correctly (0xc0150002). Click OK to close the application."
我使用Dependency Walker运行它,但显示并排错误,如下所示:
Error: The Side-by-Side configuration information for "D:\project\..\debug\VLD_X86.DLL" contains errors. The application has failed to start because its side-by-side configuration is incorrect.)
我尝试了多种方法,包括按此处建议的方法修改 list :
https://vld.codeplex.com/discussions/360243
仅当我在vld.h上注释了以下行时,它才能正常运行
// Force a symbolic reference to the global VisualLeakDetector class object from
// the DLL. This ensures that the DLL is loaded and linked with the program,
// even if no code otherwise imports any of the DLL's exports.
//#pragma comment(linker, "/include:__imp_?g_vld@@3VVisualLeakDetector@@A")
但是,如果我注释掉该行,则vld根本不输出任何内容(就像没有vld集成一样)
有人遇到过这个问题吗?任何建议将不胜感激,在此先感谢!
最佳答案
我也遇到了这个问题,您需要将所有这些文件添加到与 vld_x86.dll/vl_x64.dll 相同的目录中:
Microsoft.DTfW.DHL.manifest
dbghelp.dll
来自Visual Leak Detector的Win32/Win64 bin文件夹。发现于:https://vld.codeplex.com/wikipage?title=Building%20Visual%20Leak%20Detector%20from%20Source