Small program producing binary with large filesize

Steven Schveighoffer schveiguy at gmail.com
Tue Jul 31 19:32:54 UTC 2018


On 7/31/18 11:19 AM, Dan Barbarito wrote:
> Hi all,
> 
> I am starting to write a command line tool. So far it is a small 
> (feature-wise) program but the file size is scaring me. It's already 13 
> megabytes, but I would expect it to be much smaller. Is it because I'm 
> using 3 libraries so far? The libraries are: mir, vibe.d, and d2sqlite3. 
> Would using these libraries be causing this file size?
> 
> The code can be found here 
> (http://fossil.barbarito.me/finbot/zip/finbot.zip), if anyone wants to 
> take a look. I am simply running "dub build" to build the binary. I 
> tried running "dub build --build=release" but that didn't effect the 
> file size too much.
> 
> Thanks!

D is statically linked, so the file size includes ALL the libraries 
(except for the C dynamic ones). Comparing this to C binaries, which are 
generally only linked dynamically, you will see much larger sizes.

-Steve


More information about the Digitalmars-d-learn mailing list