From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Compiling (exreeeem newbie) Date: Fri, 26 Dec 1997 22:41:48 -0500 Organization: Two pounds of chaos and a pinch of salt. Lines: 33 Message-ID: <34A478FC.4455@cs.com> References: <680bb6$7qb AT mn5 DOT swip DOT net> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp201.cs.com 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 D Hacker wrote: > > Hi! > I am lerning c++ but I have a big problem. > When I tried to compil the simple file below (inledn.cpp) I got this > message: > d:/djgpp/tmp\ccdaaaaa(.text+0x16):inledn.cc: undefined reference to `cout' > d:/djgpp/tmp\ccdaaaaa(.text+0x1b):inledn.cc: undefined reference to > `ostream::op > erator<<(char const *)' This means you failed to link the C++ libraries. Add "-lgpp" to the end of your command line, or use 'gxx' instead of 'gcc' to compile C++ programs. > I run djgpp in DOS, and to compill i use the commando: gcc inledn.cpp (i > have tried -o but gcc dosent't know that comman). '-o' is used to tell gcc what file to output. Try "gcc -o inledn.exe inledn.cpp -lgpp". BTW, this stuff is covered in 'readme.1st' and the FAQ (v2/faq210b.zip or online at http://www.delorie.com/djgpp/v2faq/). hth -- --------------------------------------------------------------------- | John M. Aldrich | "Waking a person unnecessarily | | aka Fighteer I | should not be considered a capital | | mailto:fighteer AT cs DOT com | crime. For a first offense, that | | http://www.cs.com/fighteer | is." - Lazarus Long | ---------------------------------------------------------------------