From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: how compile with djgpp ? Date: Sun, 03 May 1998 00:16:43 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 63 Message-ID: <354BEFAB.7613@cs.com> References: <6ig1pm$gdc$2 AT news3 DOT isdnet DOT net> NNTP-Posting-Host: ppp142.cs.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk birot gorka wrote: > > i have emacs but i can't use the toolbar so i don't how to compile my > program. I want to assume that you've downloaded and installed the required DJGPP distribution, either as described in 'readme.1st' or via the Zip Picker on http://www.delorie.com/djgpp/. If not, please go back and do so. There are instructions for compilation in 'readme.1st', and you can find a User's Guide online on http://www.delorie.com/djgpp/doc/ug/. Finally, the DJGPP Frequently Asked Questions list (v2/faq210b.zip or http://www.delorie.com/djgpp/v2faq/) is an invaluable resource for beginning and advanced users alike and we recommend that you read it all the way through at least once. Please try to find these resources for yourself before asking such basic questions. But since you did ask, and I don't have anything better to do, I'll give you a brief answer. DJGPP is built around a command-line compiler named 'gcc'. This is the main driver that you use to handle just about all your compilation needs. The simplest format is: gcc program.c This compiles your program and produces an executable 'a.exe'. To specify the output file, use the '-o' parameter as follows: gcc -o program.exe program.c To add warnings, optimization, and full debugging information, use the '-Wall', '-O', and '-g' switches, respectively: gcc -Wall -O -g -o program.exe program.c To compile C++ programs, you must either link the C++ libraries manually or substitute 'gpp' for 'gcc': gcc -Wall -O -g -o program.exe program.cpp -lstdcxx gpp -Wall -O -g -o program.exe program.cpp For programs that use GNU classes such as String, you must also link '-lgpp' manually: gcc -Wall -O -g -o program.exe program.cpp -lstdcxx -lgpp gpp -Wall -O -g -o program.exe program.cpp -lgpp Note that linking with libgpp.a places your programs under the GNU Library General Public License, which restricts the ways in which you can distribute it. Emacs supports built-in compilation with capture of output (M-x compile), but you must still provide it with a command line or write a makefile for Make to use. For further information, please read the documentation. It's there to help you. -- --------------------------------------------------------------------- | John M. Aldrich | "Courage is the complement of fear. | | aka Fighteer I | A man who is fearless cannot be | | mailto:fighteer AT cs DOT com | courageous. (He is also a fool.)" | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------