Skip to main content
GameDev.net gamedev.net
🔒 Locked

/MD or /MT

Started by Trip99 Sep 13, 2006 at 5:31 AM 4 replies 2k views
Original Post
Trip99
Trip99
Hi, I recently ported a library project (a simple 2D API) from Visual Studio 2003 to Visual Studio 2005. I found that using the statically linked Runtime Libraries (MT - Multi Threaded) meant an enormous lib file size. I expect it to be large as it has all the library functionality in the lib however it is huge compared to the 2003 version. If I switch to DLL linked libraries (MD - Multi Threaded DLL) then the file size is much reduced but it is still larger than the size from 2003 and of course means users of my library will need to use MD and distribute all the run time library dlls with their apps. I would much prefer a self contained exe. What have other people been doing to solve this? Sizes Under Visual Studio 2003 the lib is 211 KB Under Visual Studio 2005 with MT it is 1029 KB Under Visual Studio 2005 with MD it is 456 KB
------------------------See my games programming site at: www.toymaker.info
_Madman_
_Madman_
Use VS2003 when you compile your project for a release!

Multithreaded lib's are way bigger, and especially in VS2005. If you want compact application use VS2003 + single threaded libs and maybe even try using mainCRT startup and import only the things you need... If done carefully directx 3D shooters with shaders can be packed into 75kb or so, can't find the link now...
______Madman
deffer
deffer
Quote:
Original post by Trip99
Hi, I recently ported a library project (a simple 2D API) from Visual Studio 2003 to Visual Studio 2005. I found that using the statically linked Runtime Libraries (MT - Multi Threaded) meant an enormous lib file size. I expect it to be large as it has all the library functionality in the lib however it is huge compared to the 2003 version. If I switch to DLL linked libraries (MD - Multi Threaded DLL) then the file size is much reduced but it is still larger than the size from 2003 and of course means users of my library will need to use MD and distribute all the run time library dlls with their apps. I would much prefer a self contained exe. What have other people been doing to solve this?

Sizes

Under Visual Studio 2003 the lib is 211 KB
Under Visual Studio 2005 with MT it is 1029 KB
Under Visual Studio 2005 with MD it is 456 KB


Did you actually tried to run your /MD app on a non-developer machine?
Some people had problems with this.
If you managed to solve this, would you mind sharing your settings?
EDIT: nevermind, the original problem was solved

~def

[Edited by - deffer on September 13, 2006 10:21:12 AM]
Emmanuel Deloget
Emmanuel Deloget
Enormous lib file size != enormous exe size. There are some informations in the lib file that are not stored in the final exe file.

Moreover, having a file size of 1 MB doesn't sound too enormous - unless you have 4 MB of RAM, which I doubt :)

Regards,
Trip99
Trip99
Hi, thanks for the replies. Going back to 2003 seems like a bacward step :) I know that using /MD means that dlls may need installing on a users machine ideally using an installer otherwise I do not fancy messing with merge files! If I go this route I will certainly report any issues that come up.

I know that when linked into an exe a lot of stuff may not be included hence a lower sized exe but I want to distribute the lib intself so it is its size that is important.

Me making the decision between MD and MT forces the user of my lib to use the same setting.

I am leaning toward using MT and to just live with the file size - at least it prevents a user of my lib having to get their users to install library files.
------------------------See my games programming site at: www.toymaker.info
Trip99
Trip99
Just a follow up for anyone else considering the best way to go:

I used the Multi Threaded DLL approach and created an app that I then ran on another machine that had never had a development environment and it ran no problem. I suspect most people already have msvcr80.dll installed from other apps. So it makes sense to use this approach and if someone is missing the dll direct them to a place to download it.
------------------------See my games programming site at: www.toymaker.info

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.