When you strip the executable, what is actually removed? Should all release
versions of executables be stripped? I mean, the information that is removed
from the binary, is that only good for debugging purposes?
Regards
Philip Bennefall
----- Original Message -----
From: "Per Westermark" <pw...@ia...>
To: "Philip Bennefall" <phi...@pb...>
Cc: <Dev...@li...>
Sent: Tuesday, February 13, 2007 4:53 PM
Subject: Re: [Dev-C++] Huge executables
> If I just copy your code to test_size.cpp and then do:
> g++ test_size.cpp
> on your source, I get a binary that is 475kB.
>
> If I strip the binary, it will shrink to 266kB.
>
> This with MinGW gcc 3.4.2.
>
> Alas, the c++ library is quite aggresive at adding stuff to hello-world
> applications. The good part is of course that when you do add real code to
> the project, a large part of the RTL is already included, so the binary
> will not continue to grow at the same high speed.
>
> /Per W
>
> On Tue, 13 Feb 2007, Philip Bennefall wrote:
>
>> Hey folks,
>>
>> I've been feeling for a while that my executables have been much larger
>> than they need to be, so I tried to make a very simple console
>> application in C++ using iostream and nothing more. This code generates
>> an executable that is over 400 kb!
>>
>> ---Code begin---
>> #include <iostream>
>>
>> using namespace std;
>>
>> int main()
>> {
>> int year;
>> cout << "How old are you?\n";
>> cin >> year;
>> cout << "Okay, you are " << year <<" years old.\n";
>> fflush(stdin);
>> getchar();
>> }
>> ---Code end---
>>
>> This, I should imagine, would be something like 20 kb. I looked in the
>> FAQ of course, and it said that I should make sure that I don't have
>> debugging enabled. It does not look like it is, and I just can't figure
>> out why the files are so huge. iostream, that's really small. Can anyone
>> help? I have not modified any settings in compiler options at all.
>>
>> Regards
>> Philip Bennefall
>
>
|