Thursday, April 3, 2008

MSVCR71.dll not found or MSVCP71.dll not found

I had an application and everything works fine in Windows XP, however when I installed the application on Vista, certain features did not work and gave me an error that MSVCR71.dll was not found.  Well, sure enough the dll wasn't on the Vista machine and it was on the other machines that I was testing on.

My initial thought was to add the dll's to the setup application.  But then I read an article that if you wanted to deploy these dll's to just add the merge module VC_User_CRT71_RTL_X86_---.msm from Program Files\Common Files\Merge Modules.  So I did this.  Right-click on your Setup application, select Add, then select Merge Module... and then select the module.  In the properties for the file, make sure you install it in the application folder and not the setup folder.  Ok, I tried this and still my application wasn't working. 

So I finally decided to just add the dll's directly.  Well, I right-clicked on the setup application, select Add, File.  And then navigated to the Windows\System32\ directory.  Found MSVCR71.dll and MSVCP71.dll (it turns out you need this one as well), and when I attempted to add them, I got a message that said that these two dll's were found in the vc_user_stl71_rtl_x86_---.msm and would I like to add that instead.  So I said "Yes", then I got a message to add VC_User_CRT71_RTL_X86_---.msm, so I said ok.  Installed the application on the Vista machine and everything worked fine.    What ends up getting installed on the Vista machine are the dll's, not the msm files.

Anyways, the moral of the story is that if you need a dll, just go straight to it, instead of trying to figure out what msm files.  The setup application is smart enough to figure out if that dll has an associated merge module.  I think :-)