Connecting Tech Pros Worldwide Help | Site Map

dev-cpp

 
LinkBack Thread Tools Search this Thread
  #1  
Old October 11th, 2005, 09:05 AM
bob@coolgroups.com
Guest
 
Posts: n/a
Default dev-cpp

Does anyone know how to reduce the size of an executable that Dev-c++
creates?

Thanks.


  #2  
Old October 11th, 2005, 09:25 AM
sat
Guest
 
Posts: n/a
Default 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]


  #3  
Old October 11th, 2005, 09:35 AM
Divick
Guest
 
Posts: n/a
Default Re: dev-cpp

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

Divick

  #4  
Old October 11th, 2005, 10:25 AM
Maxim Yegorushkin
Guest
 
Posts: n/a
Default 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.

  #5  
Old October 11th, 2005, 11:45 AM
remus.dragos@gmail.com
Guest
 
Posts: n/a
Default 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!

  #6  
Old October 11th, 2005, 12:15 PM
Greg
Guest
 
Posts: n/a
Default 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

  #7  
Old October 11th, 2005, 01:35 PM
Maxim Yegorushkin
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.