19

我在 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 集成一样)

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

4

5 回答 5

25

我也遇到了这个问题,您需要将所有这些文件添加到与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

于 2013-11-19T06:43:56.933 回答
2

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

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

于 2014-07-14T06:10:59.787 回答
0

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

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

于 2018-09-12T08:52:16.900 回答
0

在安装 vld 后尝试运行项目时出现此类错误。我的解决方案是重新登录。因为 vld 安装程序将新路径添加到 PATH 并且 VS 在没有重新登录的情况下看不到它们。否则,您可以使用复制文件 dbghelp.dll 和 .manifest 的解决方案。

于 2018-12-24T11:22:19.167 回答
0

如果您使用的是 Visual Studio

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

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

于 2015-07-28T23:27:46.850 回答