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

5

19

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!

Merrile answered 7/10, 2013 at 2:46 Comment(0)
S
25

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

Smokestack answered 19/11, 2013 at 6:43 Comment(2)
This answer saved my day. My project started showing "0xc0150002" after I upgraded CEF1 to CEF3, and adding "Microsoft.DTfW.DHL.manifest" to the same folder of the other 2 dll (vld version v2.4rc2) fixed it.Tailpipe
I am on Windows 7 64-bit, trying to compile my project as 32bit, but this method does not work for me. (I just copied all files from folder ...\ConsoleApplication2\packages\VisualLeakDetector.2.5.0.0\lib\native\address-model-32\lib to ...\ConsoleApplication2)Aposiopesis
F
2

I had this problem (this error message), too. In my case the vld_x86.dll, most likely in another than the expected version, was preinstalled and registered by some other software. (everybody likes VLD, it seems) Thus, it was loaded instead of the vld_x86.dll in the path VLD was built to. Unregistering the foreign DLL solved the problem.

Hence, you might want to check the output for loading of DLLs from exotic paths.

Fancyfree answered 14/7, 2014 at 6:10 Comment(0)
N
0

If you are using Visual Studio

  • The simplest fix if you have not been messing with your project properties in the include, linker sections is to make sure that you did not manually add VLD. Instead clear the includes you made in here and save your project.

  • Close it then install the latest VLD and it will automatically create the includes parent inheritance for your Visual Studio projects including environment paths as well.

Nomology answered 28/7, 2015 at 23:27 Comment(0)
H
0

Other might still get into the issue;
A potential fix is to install VLD version 2.5.1, can be downloaded from github: https://github.com/KindDragon/vld/releases/tag/v2.5.1

It brings the fix explained above, it includes dbghelp.dll

Hanseatic answered 12/9, 2018 at 8:52 Comment(0)
G
0

I got such error when I tried to run a project just after installing vld. A solution for me was re-login. Because vld installer adds new paths to PATH and VS doesn't see them without re-login. Otherwise you can use a solution with copying files dbghelp.dll and .manifest.

Girder answered 24/12, 2018 at 11:22 Comment(2)
It's sufficient to just restart the VisualStudio in this case, no need to re-login.Mailemailed
I had tried just to restart VisualStudio, but it didn't work without re-login.Girder

© 2022 - 2024 — McMap. All rights reserved.