Thread: C++ executable sizes

  1. #16
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by Damos View Post
    I have a skeleton GUI app written in c++ thats weighs in at a mere 5K!
    Which C++ libraries are you using?
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  2. #17
    Registered User UltraKing227's Avatar
    Join Date
    Jan 2010
    Location
    USA, New york
    Posts
    123
    unless the C++ libraries are manually edited to only include what
    you need, its almost impossible to get a Win32 program which is
    only 5k.

  3. #18
    Registered User
    Join Date
    Apr 2010
    Posts
    4
    No crt library! no Icon's or resources, exception handling turned off & buffer checking off.
    This does however mean that you have to do your own memory managment(you can still override new & delete.) Global constructors will not be initialized.
    but it is doable, there are restrictions but you can still do a lot.

  4. #19
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by Damos View Post
    No crt library! no Icon's or resources, exception handling turned off & buffer checking off.
    This does however mean that you have to do your own memory managment(you can still override new & delete.) Global constructors will not be initialized.
    but it is doable, there are restrictions but you can still do a lot.
    Some of those restrictions (eg global objects not being initialised) mean that you may be using a C++ compiler, but the code is far removed from being C++.

    There comes a point when, if you tweak compiler settings enough, a compiler for language X becomes a compiler for a language Y that has similar syntax but is actually very different.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  5. #20
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Well, my biggest C GUI was several thousand lines -- actually, the source code is about 95k. Took me a long time.

    The executable is 80k, and it's not really "trivial", either (there's a text area, buttons, menus, layered regular expression searching, a local socket server, input processing, hyperlinking, etc). I'm guessing if I had used C++ and the STL, the code base would be somewhat smaller but the executable would quadruple in size, at least.
    Last edited by MK27; 04-09-2010 at 07:33 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-10-2009, 12:57 AM
  2. Loading a DLL that is not in the same directory as the executable
    By starcatcher in forum Windows Programming
    Replies: 10
    Last Post: 12-13-2008, 07:05 AM
  3. CreateProcess with Resource of executable, not the Filename
    By Ktulu in forum Windows Programming
    Replies: 4
    Last Post: 11-04-2006, 01:07 AM
  4. calling an executable from an executable
    By dee in forum C Programming
    Replies: 4
    Last Post: 01-10-2004, 01:32 PM
  5. Altering The Program's Executable?
    By Aidman in forum C++ Programming
    Replies: 7
    Last Post: 12-31-2002, 05:11 AM