Date: Wed, 25 Aug 1999 14:30:41 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Anne Hawson cc: djgpp AT delorie DOT com Subject: Re: I can't compile with the -O2 switch. In-Reply-To: <7purvn$j7h$1@nclient11-gui.server.virgin.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 24 Aug 1999, Anne Hawson wrote: > I wanted to compile C++ code into an executable with optimisations. > In this case, it is a tiny program called "keypress.cpp" > (pasted at the end of this message). > It compiles fine with - > > > gxx -o keypress.exe keypress.cpp > but complains with - > > > gxx -O2 keypress.exe keypress.cpp You need to keep the -o as well, like this: gxx -O2 -o keypress.exe keypress.cpp I believe the file README.1ST which comes with DJGPP explains how to invoke the compiler correctly.