Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Huge MinGW Libraries!!  (Read 5008 times)

0 Members and 1 Guest are viewing this topic.

PS3-690

  • Newbie
  • *
  • Posts: 2
    • View Profile
Huge MinGW Libraries!!
« on: March 31, 2008, 07:58:10 pm »
Hi,

why are the libraries built with MinGW so huge?

e.g.
sfml-system.dll built with MinGW - 500 KB
sfml-system.dll built with MSVC - 13KB

And what are these files ending with *-d.dll and *-d.dll
(example: sfml-window-d.dll) ??

greets,
PS3-690

Avency

  • Full Member
  • ***
  • Posts: 113
    • View Profile
Huge MinGW Libraries!!
« Reply #1 on: March 31, 2008, 10:18:26 pm »
The -d libraries are the debug libraries.
In general, debug libraries tend to be bigger than the release ones.
About the MinGW binaries being bigger than the msvc:
MinGW probably links some static runtimes whereas msvc mainly uses dynamic linking and presumes that the user has the msvc runtimes already installed (you can also link the msvc runtimes statically (I think?) even if this might not be the best idea).
I'm not sure about this, though.

PS3-690

  • Newbie
  • *
  • Posts: 2
    • View Profile
Huge MinGW Libraries!!
« Reply #2 on: April 01, 2008, 07:17:23 am »
I found two ways to compile the sfml-system.dll smaller.

First way is to use <cstdio> instead of <iostream>

Second way is 'Strip all symbols from binary'. (Are there any disadvantages, if you use this?)

Original: 499.78 KB

New sizes:
With cstdio: 33.83 KB
With cstdio and strip symbols:  14.00 KB

Compiled with MS VC: 12.50 KB

edit: But MSVC SFML-Window.dll is still  40 KB smaller than MinGW SFML-window.dll
edit2: And SFML-Network.dll is 270 KB (!!) smaller

Boder

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://boder.games.googlepages.com/
Huge MinGW Libraries!!
« Reply #3 on: April 02, 2008, 07:04:02 pm »
You can try for "compile for size optimization" (and you can use UPX on your executable, compiling SFML statically).

But not much worry in these days of Gigabyte+ demos!

workmad3

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Huge MinGW Libraries!!
« Reply #4 on: April 10, 2008, 11:57:27 am »
I think mingw only has a static-linked runtime library, so you will be linking items of that into the dlls increasing size.

As for the options mentioned:
#include <cstdio>
makes sense if nothing in <iostream> is used :) <iostream> usually builds on <cstdio> so they would both be included, increasing code-size.

Stripping symbols - good idea but only for release mode (and true release mode at that, not a 'release' where you are still debugging but are linking against the release libraries). The symbols are what debuggers etc. use to give better info about where a crash occured.