Good free C++ compiler for Windows?

Discussion in 'C++' started by Leif K-Brooks, Sep 13, 2003.

  1. I'm learning C++ on Windows using Borland C++, but the size of
    applications made with it are disturbingly huge -- a simple console app
    is 139 KB. I've also tried GCC (Mingw and Cygwin), but its sizes are
    even larger -- 494 KB for the same app.

    Does anyone know of another free compiler that will genererate smaller apps?
     
    Leif K-Brooks, Sep 13, 2003
    #1
    1. Advertising

  2. On Sat, 13 Sep 2003 04:17:04 -0400, Leif K-Brooks <> wrote:

    >I'm learning C++ on Windows using Borland C++, but the size of
    >applications made with it are disturbingly huge -- a simple console app
    >is 139 KB. I've also tried GCC (Mingw and Cygwin), but its sizes are
    >even larger -- 494 KB for the same app.


    This has more to do with tool usage than the tools themselves.

    If it seems to difficult to get the tools to do what you want, consider
    distribution as .zip or self-extracting archive.

    There is at least one packager for .exe's at SourgeForge.



    >Does anyone know of another free compiler that will genererate smaller apps?


    See above.

    Note that usage of specific tools is off-topic in this group.
     
    Alf P. Steinbach, Sep 13, 2003
    #2
    1. Advertising

  3. Alf P. Steinbach wrote:

    > This has more to do with tool usage than the tools themselves.


    I understand that, but 139 KB for a 21-line (with a few blank lines)
    program seems far more than necessary.

    > Note that usage of specific tools is off-topic in this group.


    I know, but it seems to be the best group for my question, and I need to
    ask it somewhere.
     
    Leif K-Brooks, Sep 13, 2003
    #3
  4. "Leif K-Brooks" <> wrote in
    message news:ZdA8b.323$2.webusenet.com...
    > I'm learning C++ on Windows using Borland C++, but the size of
    > applications made with it are disturbingly huge -- a simple console app
    > is 139 KB. I've also tried GCC (Mingw and Cygwin), but its sizes are
    > even larger -- 494 KB for the same app.
    >
    > Does anyone know of another free compiler that will genererate smaller
    > apps?


    Leif,

    I don't have an answer to that, but the FAQ addresses the question of why
    executables are sometimes larger than we might expect:

    http://www.parashift.com/c -faq-lite/class-libraries.html#faq-36.8

    It might give you some ideas about how you can reduce executable size.

    Regards,

    Russell Hanneken
     
    Russell Hanneken, Sep 13, 2003
    #4
  5. Russell Hanneken wrote:

    > I don't have an answer to that, but the FAQ addresses the question of why
    > executables are sometimes larger than we might expect:
    >
    > http://www.parashift.com/c -faq-lite/class-libraries.html#faq-36.8
    >
    > It might give you some ideas about how you can reduce executable size.

    D'oh! Reconfigured Borland C++ to use dynamic linking, and that simple
    app shot down to 7 KB. Thanks a million!
     
    Leif K-Brooks, Sep 13, 2003
    #5
  6. Leif K-Brooks

    Agent Mulder Guest

    > Does anyone know of another free compiler that will genererate smaller apps?

    Open Watcom. It's brilliant.

    http://www.openwatcom.org/

    -X
     
    Agent Mulder, Sep 13, 2003
    #6
  7. Leif K-Brooks

    llewelly Guest

    Leif K-Brooks <> writes:

    > Russell Hanneken wrote:
    >
    > > I don't have an answer to that, but the FAQ addresses the question of why
    > > executables are sometimes larger than we might expect:
    > > http://www.parashift.com/c -faq-lite/class-libraries.html#faq-36.8
    > > It might give you some ideas about how you can reduce executable
    > > size.

    > D'oh! Reconfigured Borland C++ to use dynamic linking, and that simple
    > app shot down to 7 KB. Thanks a million!


    The same tactic will make the mingw gcc produced apps much smaller as
    well.
     
    llewelly, Sep 13, 2003
    #7
  8. Leif K-Brooks

    Walter Guest

    "Leif K-Brooks" <> wrote in
    message news:ZdA8b.323$2.webusenet.com...
    > I'm learning C++ on Windows using Borland C++, but the size of
    > applications made with it are disturbingly huge -- a simple console app
    > is 139 KB. I've also tried GCC (Mingw and Cygwin), but its sizes are
    > even larger -- 494 KB for the same app.
    >
    > Does anyone know of another free compiler that will genererate smaller

    apps?

    You can try the free Digital Mars C/C++ compiler.

    -Walter
    www.digitalmars.com
     
    Walter, Sep 13, 2003
    #8
  9. Leif K-Brooks

    Mike Smith Guest

    llewelly wrote:

    > Leif K-Brooks <> writes:
    >
    >
    >>Russell Hanneken wrote:
    >>
    >>
    >>>I don't have an answer to that, but the FAQ addresses the question of why
    >>>executables are sometimes larger than we might expect:
    >>>http://www.parashift.com/c -faq-lite/class-libraries.html#faq-36.8
    >>>It might give you some ideas about how you can reduce executable
    >>>size.

    >>
    >>D'oh! Reconfigured Borland C++ to use dynamic linking, and that simple
    >>app shot down to 7 KB. Thanks a million!

    >
    >
    > The same tactic will make the mingw gcc produced apps much smaller as
    > well.


    Still not as small, though, IIRC, because while the C runtime can be
    made dynamic (using MSVCRT), the C++ runtime is still statically linked.

    --
    Mike Smith
     
    Mike Smith, Sep 16, 2003
    #9
  10. Leif K-Brooks

    d2003xx Guest

    Leif K-Brooks <> wrote in message news:<ZdA8b.323$2.webusenet.com>...
    > I'm learning C++ on Windows using Borland C++, but the size of
    > applications made with it are disturbingly huge -- a simple console app
    > is 139 KB. I've also tried GCC (Mingw and Cygwin), but its sizes are
    > even larger -- 494 KB for the same app.


    Hmmmm... Did you strip the executable or add "-s" when linking?

    >
    > Does anyone know of another free compiler that will genererate smaller apps?
     
    d2003xx, Sep 17, 2003
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wormald
    Replies:
    1
    Views:
    1,172
    Victor Bazarov
    Feb 6, 2006
  2. george
    Replies:
    0
    Views:
    1,172
    george
    Aug 29, 2008
  3. Replies:
    12
    Views:
    589
    Jorgen Grahn
    Sep 8, 2008
  4. Interrupt

    good easy to use Free C compiler!!

    Interrupt, Jan 19, 2010, in forum: C Programming
    Replies:
    50
    Views:
    2,345
    Conor
    Feb 26, 2010
  5. mohammed_a_o
    Replies:
    0
    Views:
    307
    mohammed_a_o
    Nov 30, 2010
Loading...

Share This Page