I’m trying to use Visual Leak Detector 1.9h beta in a Visual C++ project on Visual Studio 2010. When I build and run my project I get the following error:
The program can’t start because
vld.dll is missing from your computer.
Try reinstalling the program to fid
this problem.
The README that comes with VLD states for Visual C++ 8 and 9:
Go to Tools ->
Options -> Projects and Solutions ->
VC++ Directories. Select “Include
files” from the “Show Directories For”
drop-down menu. Add the include
subdirectory from the Visual Leak
Detector installation directory. Move
it to the bottom of the list. Then
select “Library files” from the
drop-down menu and add the lib
subdirectory from the Visual Leak
Detector installation directory.
Again, move it to the bottom of the
list.
The menus suggested is deprecated in VS2010. What would be the equivalent for VS2010?
I tried the following without success:
- Right click on the project \ properties \ Configuration Properties \ C\C++ \ General \ Additional Include Directories -> add “;C:\Program Files (x86)\Visual Leak Detector\include”
- Right click on the project \ properties \ Configuration Properties \ Linker \ General \ Additional Library Directories -> add “;C:\Program Files (x86)\Visual Leak Detector\lib\vld.lib”
but as you can guess, it didn’t work…
The error message you got isn’t fixable with any of the settings you’re browsing through. It is a straight-forward runtime error, Windows just cannot find the DLL that the tool needs.
First thing you need to do is find out where the installer put the vld.dll file. You are clearly running a 64-bit operating system. First look in c:\windows\system32, move it to c:\windows\syswow64 if you find it there so that 32-bit programs can find the DLL. Also check if the installer messed with the system environment PATH variable (Control Panel + System, Advanced), you may have to restart Visual Studio to make the change effective. Adding the install directory to this variable would be another solution. The last ditch make-it-work effort is to copy vld.dll into your build directory.