views:

1498

answers:

3

If the C++ runtime msvcr80.dll is missing from a compiled library, is there any way to determine which version was used to create the library or to get it to run on a later version of msvcr80.dll?

+5  A: 

Dependency Walker will help you answer this question.

David Segonds
+7  A: 

The VC80 SP1 CRT redistributable package will install both the RTM and SP1 versions of the C runtime into %SystemRoot%\WinSxS (assuming you're using Windows XP or Vista; Windows 2000 doesn't support side-by-side assemblies). If you have VC8 installed, the CRT redistributable package is in %ProgramFiles%\Microsoft Visual Studio 8\VC\redist. If you don't have VC8 installed, I think you can download the CRT redistributable package from Microsoft.com.

Also, to find out exactly what CRT version (e.g. RTM vs. SP1) is needed by a binary that was built with VC8 or VC9, you can extract the manifest:

mt.exe -inputresource:mydll.dll;#1 -out:mydll.dll.manifest

Look for something like this:

<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>

My executable requires CRT version 9.0.21022.8. This version number is also embedded in the WinSxS subdirectory names (unfortunately it's surrounded by hashes):

D:>dir c:\windows\WinSxS\*VC90.CRT*
12/14/2007  02:16 AM    <DIR>          amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b
12/14/2007  02:00 AM    <DIR>          x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91
bk1e
Mt.exe is a tool provided in the Microsoft SDK / Visual Studio Package for evaluating manifests. More information on mt.exe can be found on the MSDN documentation page :http://msdn.microsoft.com/en-us/library/aa375649(VS.85).aspx(be sure and look at the user content at the bottom)
Steve
A: 

If you're authoring and distributing the mentioned DLL, consider using a merge module for Visual C++ 8.0 CRT as part of your installer.

I noticed that there is a new mt.exe tool and new Visual C++ CRT in Windows SDK 6.1. I use the merge module as a prerequisite in the InstallShield 12 installer with great success.

GregC