Thread: .exe size with MinGW

  1. #1
    Registered User
    Join Date
    Nov 2006
    Location
    under your bed....
    Posts
    24

    .exe size with MinGW

    G'day all,

    All day today I've been trying to figure out how to lower the size of the executables that MinGW compile. I search some forums and stuff and learnt about compiler commands.

    So i compiled a hello world program at without any commands and i get an .exe of 463 KB =o.
    I then used a -s --strip-all command and the .exe when to 260 KB.

    I don't know much about compilers and i was wondering if someone could tell me what commands i should use. My mate said i should be able to get the size of the .exe to around 50 KB???

    I'm using Dev-Cpp Beta5 with MinGW.

    Cheers in advance.

  2. #2
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Look in the help files in the IDE. It will give you the answer you need. In paticular, click on FAQ, one of the questions relates to lowering the executuon size when a program is run
    Double Helix STL

  3. #3
    Registered User
    Join Date
    Nov 2006
    Location
    under your bed....
    Posts
    24
    I'm not to sure what most of the commands do. I was hoping that someone could tell me what commands i should use to get minimum .exe size.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > My mate said i should be able to get the size of the .exe to around 50 KB???
    So get him to prove he can do it.

    You could try linking with shared libraries, which are loaded with the executable when you run it (thus not really saving a lot of space), but the headline news looks good.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Heapsort
    By xENGINEERx in forum C Programming
    Replies: 2
    Last Post: 03-30-2008, 07:17 PM
  2. Invalid conversion from 'void*' to 'BYTE' help
    By bikr692002 in forum C++ Programming
    Replies: 9
    Last Post: 02-22-2006, 11:27 AM
  3. An exercise in optimization
    By Prelude in forum Contests Board
    Replies: 10
    Last Post: 04-29-2005, 03:06 PM
  4. .exe size
    By Blurry_Face in forum C++ Programming
    Replies: 10
    Last Post: 04-30-2004, 08:20 AM