Solved

Shared DLL vs Statically linked library

Posted on 1998-10-13
3
206 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
Comment Utility
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
Comment Utility
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
Comment Utility
Excellent. Between the answer and the comment, I got all the info I needed!

Thanks!

-Dex Man
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video discusses moving either the default database or any database to a new volume.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now