This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using std::string leads to large size of executable


I am using mingw with libstdc++-v3 and I get the subj. Just look for this
two examples:

1)
#include <string>
int main()
{
  std::string("a");
  return 0;
}

lead to ~200k .exe file.

2)
#include <vector>
int main()
{
  std::vector <char> a;
  return 0;
}

lead to ~50k .exe file.

I want to use std::string but it too exspensive with such size wasting. I
have tried next compilers for first example and got:
mingw-3.2: 200k
mingw-3.2 with STLport: 89k
bcc-5.5: 64k
bcc-5.6: 62k
So IMHO subj depend on GNU GCC implementation of std::string.

I wrote to MinGW support and got :

>Comment By: Luke Dunstan (infidel)
>Date: 2003-05-15 23:02

>Message:
>Logged In: YES
>user_id=30442

>What sort of response are you looking for? As far as I can
>tell, the increase due to std::string is partly because it
>somehow depends on iostreams so all the I/O stuff is linked
>in too. You can verify this because if you add #include
><iostream> and write something to std::cout then the
>executable size stays the same. If you have a problem with
>this then ask on the libstdc++ mailing list because as far as
>MinGW is concerned, a "large" executable is not a bug.

So I understand why subj. But, I still think that
implementation of std::string should be separated from
iostreams for reason building Windows GUI executables
which can use strings extensively but doesn't need iostreams.

So, if it wasn't difficult for you please to make some steps to divide
strings and iostreams.
Thank you very much.
With best regards, Sergiy Yakovyn.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]