#32 Using std::string leads to large size of executable

closed
nobody
None
1
2003-05-15
2003-05-15
No

Just look for this two examples:
1)
#include <string>
#include <vector>
int main()
{
std::string("a");
return 0;
}

lead to ~200k .exe file.

2)
#include <string>
#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.5: 56k
So IMHO the problem is in GNU GCC implementation of
std::string :(

With best regards, Sergiy Yakovin.
PS: Sorry, if my English was bad.

Discussion

  • Luke Dunstan

    Luke Dunstan - 2003-05-15

    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.

     
  • Luke Dunstan

    Luke Dunstan - 2003-05-15
    • priority: 5 --> 1
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks