Reducing Executable Size

Hi all

I am looking at reducing the size of a compiled executable for easier distribution.

What factors affect the size of an output executable?

Would literally having defined and implemented less functions, would make the exec. smaller? Meaning that instead of have a DLL ( yes im on windows ), I would download the source code of a library and comment out the functions ( and code ) that I am not using -- Would this process decrease the size of my exec.?

Many thanks,
Super_Stinger
You may strip symbols http://linux.die.net/man/1/strip and compile optimizing for size -Os

> for easier distribution.
distribute the source code.
Meaning that instead of have a DLL ( yes im on windows ), I would download the source code of a library and comment out the functions ( and code ) that I am not using -- Would this process decrease the size of my exec.?

The whole point of a DLL is that the things that are in the DLL do not get included in your executable. So manually building a smaller DLL wouldn't make any difference at all to the size of your executable.

Make sure you're building without debugging information (i.e. a Release build, if you're using MSVC). I don't know if there's a Windows equivalent for stripping the symbols.
Registered users can post here. Sign in or register to post.