Mail Archives: djgpp/1998/05/11/23:31:38
-=< 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 <iostream.h> 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.
- Raw text -