Solved

Shared DLL vs Statically linked library

Posted on 1998-10-13
3
214 Views
Last Modified: 2013-11-20
I created a new project a couple of days ago, and after working on it for these three days, the .exe is already a meg and a half. This isn't normal for me to have an exe this big (never had an eve that big...), and the only thing I did different this time, was I used statically linked libraries instead of using MFC as a shared DLL. Would this be it, and if so, how do I change it in the middle of the project to that damned exe is smaller? I don't wanna re-write all that code, and I'm sure there must be a way to change it.

-Dex Man
0
Comment
Question by:Dex_Man
3 Comments
 
LVL 1

Accepted Solution

by:
bculver earned 50 total points
ID: 1323275
This is probably due to building the .exe file as a debug version. Try rebuilding as a release version and compare the file sizes. If not, your project can be changed by manually modifying the code. The easiest way is to create two new  projects one as shared and one as static and compare the two for the differences.

0
 

Expert Comment

by:Amaresh080997
ID: 1323276
It could be due to the static linking. Go to project-settings, in the "general" tab, look at the first combobox, labelled "Microsoft Foundation Classes". Click this it will show you the option of making it a shared DLL. Now, rebuild your project. Since it is a shared DLL now, you will need to ship the microsoft dlls (like mfc42d.dll etc), when you ship your executable. Make sure your shipping version is built in release mode, so that the size of the executable is even smaller.
0
 
LVL 1

Author Comment

by:Dex_Man
ID: 1323277
Excellent. Between the answer and the comment, I got all the info I needed!

Thanks!

-Dex Man
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question