www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/15/01:15:47

Date: Thu, 15 Jun 1995 07:53:13 +0300
From: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
To: tom AT rs5 DOT tcs DOT tulane DOT edu
Subject: Re: GCC and C++ --- undefined references
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

> The error messages are:
> "undefined reference to 'cout'"
> "undefined reference to 'ostream::operator<<(char const *)'"

First (and trivial), do you #include <iostream.h>?  If so, then this is
what the FAQ says on another possible problem:
 
8.11  Q: I put all the libraries in the above order, but the linker still
         can't find some C++ functions from complex.h and iostream.
      A: These functions are declared inline.  However, GCC won't inline
         them unless you compile with optimizations enabled, so it tries
         to find the compiled version of the functions in the library.
         Workaround: compile with -O.
 
The latest version of the FAQ list is available as faq102.zip from the same
place you get DJGPP.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019