Mail Archives: djgpp/1995/10/17/04:33:02
On 15 Oct 1995, Patrick Hayes wrote:
> >>I've installed DJGPP and I can compile C programs, but when I try to compile
> >>C++ programs I get the following errors:
> >>test.cc(.text+0x14): undefined reference to `cout'
> >>test.cc(.text+0x19): undefined reference to `ostream::operator<<(char const *)'
> >add -lgpp to your command line.
>
> I came up with the same problem and I tried that and it still doesn't
> work. I have all the files that Alex has.
There is another problem which can cause this (also mentioned in the FAQ
list, which see): some C++ functions are defined only as inline
functions, without a counterpart in the library. If you don't compile
with optimizations (-O switch), Gcc won't inline such functions, and the
linker won't find them. So please try adding a -O switch to your
compilation command lines and see if that helps.
- Raw text -