Dependency Walker

The Dependency Walker is a great utility to figure out DLL problems. Here is a simple illustration of its use.

I was recently working on code shared by a friend. The C++ code compiled fine under Visual Studio 2010, but when executed would pop up this error message:

The error message:

The program can’t start because MSVCR80.dll is missing from your computer. Try reinstalling the program to fix this problem.

I dissected MSVCR80.dll as MS (Microsoft) VCR (Visual C Runtime) 80 (Visual Studio 2005) library.

The age old Windows trick of getting MSVCR80.dll from some other computer and putting it in the directory of the .exe did not work. This is because Windows now ships with a SxS system to maintain DLLs of various versions. This requires manifest files and other complicated machinery to work.

Installing the Windows 7 Platform SDK, the older Windows Server 2003 Platform SDK and Visual C++ 2005 Redistributable packages did not work either.

Having no further clue to this problem, I decided to use Dependency Walker. Execute the depends.exe and open the .exe which is throwing the error.

Dependency Walker immediately found the 3 DLLs which were causing problems. These are displayed in red in the middle pane:

To figure out the origin of the use of these DLLs, right-click on any of the problematic DLL in the middle pane and choose Highlight matching module in tree. This shows the origin of the problem in the dependency tree displayed in the top pane:

Bingo! So, a third party DLL named ILMIMF.dll that was linked with the C++ code was the cause of the error. Rebuilding this DLL separately from its source code and relinking the rest of the project fixed the error.

Advertisements

4 thoughts on “Dependency Walker”

  1. >>Rebuilding this DLL separately from its source code and relinking the rest of the project fixed the error

    Can you tell me how to rebuild this DLL separately in details? Thanks

    Like

    1. Wah: In this case, I had the source code to generate ILMIMF.DLL. I just recompiled it ensuring that its compilation options matched that of the application that I was generating.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s