我在 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.)
我尝试了各种方法,包括按照此处的建议修改清单:
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 集成一样)
以前有人遇到过这个问题吗?任何建议将不胜感激,在此先感谢!