Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user?  
Author Message
JonAkaJon





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

Compiler: Visual Studio.NET 2002

Hi everyone,

You will probably think I am a bit dim for asking this question but it is one that does confuse me.

How do I know what standard Microsoft dlls (Dynamic Link Libraries) must be sent out with my software so Windows users (even the previous Windows release users) can use my programs

I was going to link statically (as I got the impression that doing so would automatically put the dll in the final executable). Then I got some errors which got resolved when I linked dynamically instead. So even though the optimal answer would be to link statically, please answer assuming I link dynamically.

Yours with confusion,

Jon



Visual C++15  
 
 
Marius Bancila





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

Use the depends.exe tool that comes with VS to check the dependencies. It can also be downloaded from http://www.dependencywalker.com.



 
 
Craig Barkhouse





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

In addition to depends.exe already noted by another poster, you might also find this command useful:

dumpbin /dependents my.exe

Dumpbin is one of the command line tools that comes with Visual Studio.


 
 
JonAkaJon





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

Compiler: Visual Studio.NET 2002

Hi Marius and Craig,

Thanks for your great advice.

Re:
>dumpbin /dependents my.exe
>Dumpbin is one of the command line tools that comes with Visual Studio.

I do not understand this. How do I do this How do I make a command line tool

Re:
>depends.exe

I got this one working but am a little unsure of the results.

I ran depends.exe on a Microsoft Sample (A dialog box example CmnCtrl1) that ships with VS.Net 2002. It gives 5 MAIN dlls namely mfc70.dll, msvcr70.dll, kernel32.dll, user32.dll and comctl32.dll.

Somewhere in the documentation it says it is unwise to redistribute things like kernel32.dll and consequently does not appear in redist.txt.

So since mfc70.dll is the only dll that appears in redist.txt, is that the only one I need to send out

Also in the warning pain it gives a warning. It complains that it cannot find efsadu.dll.

This is confusing as this example runs. Its just a standard example.

Yours with confusion (but a little less so than before thanks to you guys),

Jon


 
 
Ovidiu Cucu





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

In any case you must NOT redistribute system DLLs like kernel32.dll, user32.dll and comctl32.dll.
But, you have to redistribute Msvcr70.dll (C runtime library) as well as mfc70.dll MFC library, which can be not present on older systems.
Place them in your application's folder.



 
 
Marius Bancila





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

You'll have to distribute mfc70.dll with your application, but if you check that DLL with depends.exe you'll see it depends upon MSVCR70.dll, so you need to distribute this one too. And you most likely also need msvcp70.dll.

 
 
Ovidiu Cucu





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

 
And you most likely also need msvcp70.dll.

Of course, but only in case of using some STL stuff. ;-)



 
 
JonAkaJon





PostPosted: Visual C++ Language, Microsoft Dynamic Link Libraries (dlls) - What ones must be given to the end user? Top

Compiler: Visual Studio.NET 2002

Hi Ovidiu, Marius and Craig,

Thanks once again for your continued great advice.

I have practiced on some microsoft example programs and think I understand now.

Re:
>Place them in your application's folder.

So that would be in c:/Program Files/MyProgram for example

Question: My redist.txt file says 'the recommended method for the redistribution of these files' is through 'merge modules'. So I guess I need to put VC_CRT.msm and VC_MFC.msm in my final redistributional I guess these unpack at install

VC_CRT.msm
msvcr70.dll

VC_MFC.msm
mfc70.dll
mfc70u.dll


Yours with thanks,

Jon