This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: undefined references
- To: Jennifer Okada <jokada at oceanit dot com>
- Subject: Re: undefined references
- From: <llewelly at dbritsch dot dsl dot xmission dot com>
- Date: Thu, 15 Jun 2000 14:35:25 -0600 (MDT)
- Cc: gcc-help at gcc dot gnu dot org
This question originially appeared on gcc-bugs; I am cc-ing to
gcc-help as it seems more appropriate.
On Thu, 15 Jun 2000, Jennifer Okada wrote:
> Hi. I'm not sure if this is the right place to ask this question but here
> goes.
>
> I'm using version egcs -2.91.66 on Red Hat Linux. I'm trying to compile a
> C++ program, but I'm getting errors about undefined references to 'cout' and
> 'ostream::operator << (int)'. I included <iostream.h> so I don't know what
> the problem is.
Without exact commandline and source code, I cannot tell what the problem
is.
> Any ideas? Thanks.
(0) Compile c++ code with 'g++', and not 'gcc'; gcc will not link in
libstdc++, g++ will.
(1) Do not use -fhonor-std unless you rebuilt your libstdc++ with
-fhonor-std .
(2) Make sure libstdc++ is installed.
The above are wild guesses; they may or may not apply to you.