我在使用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 集成一样)。
有人以前遇到过这个问题吗?任何建议将不胜感激,提前致谢!