Re: Ridiculous size of executable? [OT}

From: Bob R (removeBadBobR_at_worldnet.att.net)
Date: 05/15/04

  • Next message: James Dennett: "Re: Implement pure virtual function in base class"
    Date: Sat, 15 May 2004 03:30:55 GMT
    
    

    Jeff Schwab wrote in message ...
    >Al puzzuoli wrote:
    >> Hi,
    <snip>
    >> The code compiles and runs, but I noticed that the size of
    >> the executable is ridiculous, well over 400 kb.
    >> I am using the Dev-C++ ide and compiler. I am guessing and hoping
    that
    >> there are options for optimization that I just haven't learned yet,
    or
    >> are my expectations as to file sizes majorly skewed from my
    experiences
    >> back in the days of dos? The code I compiled was as follows:
    >>
    <snip code>
    >> Thanks,
    >> --Al
    >
    >Are executables on your platform typically smaller? Using gcc on
    Linux
    >with default settings, the program you listed compiles to an
    executable
    >of 15341 bytes.

    <borrowing your post, since I didn't load OPs. Thanks, and sorry.>

    Al puzzuoli,

    Since you are using DevCpp which usually uses GCC(MinGW), try adding
    these to your project:

    compiler flags line: -Os
    linker flags line: -s

    -Os = optomize for size.
    -s = strip the symbols
    and be sure there is no '-g' in the line.
    If there is an '-mwindows' in the line, it adds much bloat (build as a
    console app, not a windows app. Check DevCpp options.).

    Look in the GCC docs under 'GCC Command Options' for more info.

    Thanks for the use, Jeff. Sorry for the OT.

    --
    Bob R
    POVrookie
    

  • Next message: James Dennett: "Re: Implement pure virtual function in base class"

    Relevant Pages