From: "Tony O'Bryan" Newsgroups: comp.os.msdos.djgpp Subject: Re: Undefined cout??? Date: Mon, 11 May 1998 22:20:52 +0000 Organization: Southwest Missouri State Universtiy Lines: 22 Message-ID: <355779C4.63BA4460@nic.smsu.edu> References: <35570b2d DOT 11123065 AT news DOT nbnet DOT nb DOT ca> NNTP-Posting-Host: jim.a24.smsu.edu 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 -=< Darryl >=- wrote: > I am just trying to compile a simple c++ app, it doesn't do much yet, > besides print some stuff out. I use cout << "blah blah!"; I have > included and yet it spits out a whole slew of: > > c:/djgpp/tmp/cccyzcxf(.text+0x1c6):hello.cpp: undefined reference to > `cout' > c:/djgpp/tmp/cccyzcxf(.text+0x1cb):hello.cpp: undefined reference to > `ostream::o perator<<(char const *)' I'm guessing you compiled with "gcc hello.cpp -o hello.exe" or some similar command line. Use "gxx hello.cpp -o hello" instead. The problem is that you didn't link the C++ libraries. The FAQ covers this and many other problems you're likely to encounter. All DJGPP users NEED the FAQ. You can get it from the same place you downloaded DJGPP. The FAQ is really more of an all-you-need-to-know-about-most-everything-you'll-need-the-compiler-for, and is the most useful DJGPP documentation you'll find anywhere.