Re: how can I make a hello world executable as big as possible?

Discussion in 'C Programming' started by Ralph Spitzner, Mar 2, 2011.

  1. K4 Monk wrote:
    > I'm curious, how can I, either on windows or linux, compile a program
    > so that all it does is "hello world" but is heavily bloated? Is there
    > a way to statically link as many libraries as possible without using
    > them? I'm inspired by the fake interview in which Bjarne Stroustrup
    > claimed that g++ gives a 0.5 MB executable for hello world:
    > http://www.nsbasic.com/ce/info/interview.shtml
    >


    Use one "printf()"
    Link static :p

    -rasp
    Ralph Spitzner, Mar 2, 2011
    #1
    1. Advertising

  2. Ralph Spitzner

    K4 Monk Guest

    On Mar 2, 7:58 pm, Ralph Spitzner <> wrote:
    > K4 Monk wrote:
    > > I'm curious, how can I, either on windows or linux, compile a program
    > > so that all it does is "hello world" but is heavily bloated? Is there
    > > a way to statically link as many libraries as possible without using
    > > them? I'm inspired by the fake interview in which Bjarne Stroustrup
    > > claimed that g++ gives a 0.5 MB executable for hello world:
    > >http://www.nsbasic.com/ce/info/interview.shtml

    >
    > Use one "printf()"
    > Link static :p
    >
    >         -rasp


    How can I do this? Wait, let me check the gcc manpage :3
    K4 Monk, Mar 2, 2011
    #2
    1. Advertising

  3. Ralph Spitzner

    K4 Monk Guest

    On Mar 2, 7:58 pm, Ralph Spitzner <> wrote:
    > K4 Monk wrote:
    > > I'm curious, how can I, either on windows or linux, compile a program
    > > so that all it does is "hello world" but is heavily bloated? Is there
    > > a way to statically link as many libraries as possible without using
    > > them? I'm inspired by the fake interview in which Bjarne Stroustrup
    > > claimed that g++ gives a 0.5 MB executable for hello world:
    > >http://www.nsbasic.com/ce/info/interview.shtml

    >
    > Use one "printf()"
    > Link static :p
    >
    >         -rasp


    Excellent, I got a binary 676K in size...
    K4 Monk, Mar 2, 2011
    #3
    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. vijay
    Replies:
    8
    Views:
    705
  2. Roy
    Replies:
    6
    Views:
    611
    Roedy Green
    Jan 7, 2008
  3. Shaguf
    Replies:
    0
    Views:
    351
    Shaguf
    Dec 24, 2008
  4. K4 Monk
    Replies:
    2
    Views:
    298
    David Thompson
    Mar 10, 2011
  5. Larry
    Replies:
    27
    Views:
    424
    Michele Dondi
    Jan 25, 2005
Loading...

Share This Page