问题描述
我在Visual Studio 2010的Win32项目中包括vld.h,vld.lib和vld_x86.dll。它正确建立,但是当我执行时,它会崩溃的消息:
应用程序无法正确启动(0xc0150002)。单击确定关闭应用程序。
我使用Dependency Walker运行它,但它显示并排错误如下:
错误:D:\project\..\debug\VLD_X86.DLL的并行配置信息包含错误。应用程序未能启动,因为其side-by-side配置不正确。)
各种方式,包括修改清单如下所示:
https://vld.codeplex.com/discussions/360243
只有在vld.h中注释了以下行时,它才能正常运行
//从
// DLL中强制对全局VisualLeakDetector类对象的符号引用。这确保DLL被加载并与程序
//链接,即使没有代码否则导入任何DLL的导出。
//#pragma comment(linker,/ include:__ imp_?g_vld @@ 3VVisualLeakDetector @@ A)
b $ b
但是,如果我注释掉这一行,vld根本不输出任何东西(就像没有vld集成一样)
任何人遇到这个问题之前?任何建议将不胜感激,提前感谢!
我有这个问题,你需要添加所有这些文件与 vld_x86.dll / vl_x64.dll 相同的目录:
Microsoft.DTfW.DHL.manifest p>
dbghelp.dll
这是来自Visual Leak的Win32 / Win64 bin文件夹探测器。找到此:
I included vld.h, vld.lib and vld_x86.dll on my Win32 project with visual studio 2010. It builds properly but when I execute, it crashes with this message:
"The application was unable to start correctly (0xc0150002). Click OK to close the application."
I run it with Dependency Walker but it shows side by side error as follows:
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.)
I have tried various ways including tinkering around with the manifest as suggested here:
https://vld.codeplex.com/discussions/360243
It only runs properly if I commented the following line on 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")
However, if I commented out that line, the vld doesn't output anything at all (just like no vld integration)
Anyone having this problem before? Any suggestions will be appreciated, thanks in advance!
I had this problem too, you need to add all these files to the same directory as your vld_x86.dll/vl_x64.dll:
Microsoft.DTfW.DHL.manifest
dbghelp.dll
Which came from the Win32/Win64 bin folder from Visual Leak Detector. Found this from: https://vld.codeplex.com/wikipage?title=Building%20Visual%20Leak%20Detector%20from%20Source
这篇关于“应用程序无法正确启动”后包括vld.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!