This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: undefined references



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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]