www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1999/06/10/06:01:56

Message-ID: <375F8B6C.8F6976CD@tls.msk.ru>
Date: Thu, 10 Jun 1999 13:54:52 +0400
From: "Michael Ju. Tokarev" <mjt AT tls DOT msk DOT ru>
Organization: Telecom Service, JSC
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: ru,en
MIME-Version: 1.0
To: pgcc AT delorie DOT com
Subject: Re: "cout has different size..."
References: <199906090241 DOT WAA07073 AT acheron DOT aldhfn DOT org>; from Christopher D. Morgan on Tue, Jun 08, 1999 at 10:30:53PM -0400 <199906100217 DOT WAA21261 AT acheron DOT aldhfn DOT org>
Reply-To: pgcc AT delorie DOT com

"Christopher D. Morgan" wrote:
> 
> In response to my stupid question, Marc Lehmann wrote:
> >
> > > As of few days ago, compiling programs with pgcc-g++ now produces the
> > > ominous message, "symbol 'cout' has different size in shared object,
> > > consider re-linking".  (A program is now mysteriously hanging and I
> > > wonder if it related, or if I am really that bad of a programmer :-)
> >
> > This is most probably caused by a mismatched libstdc++ with respect to
> > your system libc. Have you recently upgraded to glibc-2.1 or have you
> > replaced any compiler or libraries?
> 
> Yes, I probably did several of these.
> 
> >
> > > What causes this message?  Any idea what kind of re-linking is being
> > > talked about?  What should I do about this?
> >
> > Recompiling should suffice. If not, you have a bigger problem ;)
> 
> Excellent!
> 
> Recompile what?  pgcc?  my program?  glibc?  (Yes, this is a real
> question, and yes, I realize how silly it must seem.)

As stated in pgcc's message, cout is in trouble. `cout' is a C++ standard
stream (as stdout in C), so it is in the C++ library, e.g. in libstdc++.
Trouble can come from (at least) three places:
  1) libstdc++ shared library does not corresponds to header files,
    where cout was declared differently than it was declared when shared library
    was built -- check versions of shared library and header files.
  2) shared library was compiled by different compiler (old gcc, for example),
   that uses other alignment in structures, or some other.
  3) (variant of 1) you libstdc++ header files that comes with libstdc++ shared library
   was installed in different location (e.g. in /usr/include/g++), but pgcc
   tries to find them in it's own (e.g. /opt/pgcc/include/...) place, where
   that headers (comes with pgcc, not libstdc++) really exists...
In both cases you can recompile libstdc++ library, but make shure that you
use the same header files (cames with libstdc++ source) for compiling
library and your program.
In case 3), you simply can make shure to point pgcc to the right headers...
I think that you don't need to recompile glibc or pgcc...

[snip]

> Christopher D. Morgan

Michael.

- Raw text -


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