Connecting Tech Pros Worldwide Help | Site Map

dev-cpp

bob@coolgroups.com
Guest
 
Posts: n/a
#1: Oct 11 '05
Does anyone know how to reduce the size of an executable that Dev-c++
creates?

Thanks.

sat
Guest
 
Posts: n/a
#2: Oct 11 '05

re: dev-cpp


do you mean MSdev C++ or just dev C++

first thing to do is that you build it in release configuration ,
exe generated by debug configuration is much bigger than that by release
configuration.

if it is msdev, i can give you the specific project settings to make it
space efficient..

<bob@coolgroups.com> wrote in message
news:1129020825.109867.219600@o13g2000cwo.googlegr oups.com...[color=blue]
> Does anyone know how to reduce the size of an executable that Dev-c++
> creates?
>
> Thanks.
>[/color]


Divick
Guest
 
Posts: n/a
#3: Oct 11 '05

re: dev-cpp


You can use the strip utility installed in the bin directory.

Divick

Maxim Yegorushkin
Guest
 
Posts: n/a
#4: Oct 11 '05

re: dev-cpp



bob@coolgroups.com wrote:[color=blue]
> Does anyone know how to reduce the size of an executable that Dev-c++
> creates?[/color]

pass -Os option to gcc and -s option to the linker.

Note that if you intend to distribute your binary in the Internet you
will probably have to pass -static option to the linker, so that you
binary won't depend on gcc shared libraries which are not likely to be
available on most windoze machines.

remus.dragos@gmail.com
Guest
 
Posts: n/a
#5: Oct 11 '05

re: dev-cpp



bob@coolgroups.com wrote:[color=blue]
> Does anyone know how to reduce the size of an executable that Dev-c++
> creates?
>
> Thanks.[/color]

Dev-cpp uses mingw by default to produce executables, and
you probably created a standard C++ project witch is by default at
least 145 kb. A standard C project with is at least 15 kb long.
Why this? Because C++ is very complicated internally and must be
generated code to support all those operations that you normally use to
read/write to buffers, files etc..

This is not a bug but a feature.

If you try to reduce the size follow these steps:
1a) The dangerous way: cut manually or with a hex editor the debug info
generated by linker..this will reduce 30-40 kb
1b) Then you can pack it more by selecting an option in the ide(or
command line)

2) The second is to use a packer like: UPX, witch is one of the best
and you may gain around 60% reducing.

There are other ways but these are the most common!

I hope it helped!

Greg
Guest
 
Posts: n/a
#6: Oct 11 '05

re: dev-cpp



bob@coolgroups.com wrote:[color=blue]
> Does anyone know how to reduce the size of an executable that Dev-c++
> creates?
>
> Thanks.[/color]

Yes, write less code.

Greg

Maxim Yegorushkin
Guest
 
Posts: n/a
#7: Oct 11 '05

re: dev-cpp



remus.dragos@gmail.com wrote:

[]
[color=blue]
> 1a) The dangerous way: cut manually or with a hex editor the debug info
> generated by linker..this will reduce 30-40 kb[/color]

there is a tool for that: strip

Closed Thread