包含 VLD.h 后的"The application was unable to start correctly"

"The application was unable to start correctly" after including vld.h

本文关键字:unable to start correctly was The VLD 后的 包含 application      更新时间:2023-10-16

我在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."

我使用依赖沃克运行它,但它并排显示错误,如下所示:

Error: The Side-by-Side configuration information for "D:project..debugVLD_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 集成一样)

以前有人遇到过这个问题吗?任何建议将不胜感激,提前感谢!

我也遇到了这个问题,您需要将所有这些文件添加到与vld_x86.dll/vl_x64.dll相同的目录中:

Microsoft.DTfW.DHL.manifest

dbghelp.dll

它来自视觉泄漏检测器的Win32/Win64垃圾箱文件夹。从以下位置找到这个: https://vld.codeplex.com/wikipage?title=Building%20Visual%20Leak%20Detector%20from%20Source

我也遇到了这个问题(此错误消息)。就我而言,vld_x86.dll很可能是预期版本以外的版本,是由其他软件预装和注册的。(似乎每个人都喜欢VLD)因此,它被加载而不是VLD构建路径中的vld_x86.dll。取消注册外部 DLL 解决了该问题。

因此,您可能需要检查输出以从外来路径加载 DLL。

其他人可能仍然会遇到这个问题;
一个可能的解决方法是安装 VLD 版本 2.5.1,可以从 github 下载: https://github.com/KindDragon/vld/releases/tag/v2.5.1

带来了上面解释的修复程序,它包括 dbghelp.dll

当我在安装 vld 后尝试运行项目时,我遇到了这样的错误。对我来说,一个解决方案是重新登录。因为 vld 安装程序会向 PATH 添加新路径,而 VS 如果不重新登录,则看不到它们。否则,您可以使用复制文件 dbghelp.dll 和 .manifest 的解决方案。

如果您使用的是Visual Studio

  • 如果您没有弄乱包含链接器部分中的项目属性,最简单的解决方法是确保您没有手动添加 VLD。而是清除您在此处创建的包含并保存您的项目。

  • 关闭它,
  • 然后安装最新的VLD,它将自动为您的Visual Studio项目创建包含父继承,包括环境路径。