Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MFC Dynamic linking - Please read me!

Status
Not open for further replies.

Robertus

Programmer
Feb 16, 2001
81
RO
I created an app with AppWizard and I specified "MFC dynamically linked library". The problem is when I want to run the program on a machine that doesn't have VStudio installed, it asks me for a "mfc42d.dll". How could I modify my app so that it can run without asking for that .dll? I mean how could I make it "Statically linked library"
 
> I mean how could I make it "Statically linked library"

In the project 'options' dialog

-pete
 
Under the Project menu select Settings... (or press Alt+F7). Under the first tab is a combo box allowing to specify how to use MFC, just switch to static linking there.

Another thing you might want to consider is this: You've indicated that the required DLL is MFC42D.DLL - a DLL that contains debugging information. Chances are you are trying to distribute a program that was compiled using the debug configuration - which means your exe also has debugging information in it.

If your program is ready for distribution, you can make a smaller exe by changing the active configuration to release (under the build menu select Active configuration... and switch to Win32 Release). A release build will be smaller and faster than a debug build because all that erroneous debugging info is stripped out. BTW, this is not the same as statically linking. Instead of using MFC42D.DLL it will be using MFC42.DLL unless you also change the settings for a static link.
 
Yes, but something VERY strange happens when I compile in Release version!!!! My app doesn't display the bmp correct!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top