delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/22/13:34:32

Message-Id: <199910230513.XAA22961@lakdiva.slt.lk>
From: "Kalum Somaratna" <kalum AT myflat DOT com>
To: djgpp AT delorie DOT com
Date: Fri, 22 Oct 1999 23:12:55 +0600
MIME-Version: 1.0
Subject: Re: Why are my c++ .exe's so large
In-reply-to: <380fd475.6115722@news3.newscene.com>
X-mailer: Pegasus Mail for Win32 (v3.12)
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 21 Oct 99, at 22:04, Katy <kcdixon AT hotbot DOT com> wrote:

> I am able to compile both c and c++ code, however, all my exe's that
> are compiled with gpp are HUGE! 
> 
> For example a simple "Hello World" exe, is ~ 268,000 KB.
> I use the following commands to compile the hello.cpp
> 	gpp -c -o hello.o hello.cpp
> 	gpp -o hello.exe hello.o
> 
> How can I make my exe's smaller, is there a switch that I can use to
> do this.

Greetings Katy,
There are two ways to reduce the exe file size.
 
1.  to add the switch -s to your command line.
for example
'gcc hello.cpp -o hello.exe -s'   
This will cause the linker not to put debug info in the exe.

2. run strip.exe on the created EXE.
example try running "strip hello.exe" wich will remove all  debug 
info from the exe.

Section 8.13 of the DJGPP FAQ has more if you are interested.

If you further want to make your EXE's smaller  You can try getting 
one of the following executable file compressors UPX or DJP.

Bye!
Kalum Somaratna.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019