Article View: gnu.g++.lib.bug
Article #261Re: Linker error on HP with libg++-2.2
From: Roger Sheldon - AISS
Date: Sun, 16 Aug 1992 23:33
Date: Sun, 16 Aug 1992 23:33
60 lines
2795 bytes
2795 bytes
In article <1992Aug14.063108.21613@ulrik.uio.no> per@teknologi.agderforskning.NO (Per Sigmond) writes:
>The loader cannot find the symbol _vt.filebuf. Error message:
>
> gcc -o tFile tFile.o ../../libg++.a
> ld: Unsatisfied symbols:
> _vt.filebuf (data)
>
I'm having a similar problem with gcc 2.1 and libg++ 2.0 under ISC 3.0
(a 386 Unix).
I successfully compiled libg++, but when I try to compile
a simple program like:
----
#include <iostream.h>
int main() { cout << "hello"; }
----
I get the following:
% g++ -v hello.c
Reading specs from /usr/local/lib/gcc-lib/i386-isc/2.1/specs
gcc version 2.1
/usr/local/lib/gcc-lib/i386-isc/2.1/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GN
UG__=2 -D__cplusplus -Dunix -Di386 -D__unix__ -D__i386__ -D__unix -D__i386 hello
.c /usr/tmp/cca03181.i
GNU CPP version 2.1 (80386, ATT syntax)
/usr/local/lib/gcc-lib/i386-isc/2.1/cc1plus /usr/tmp/cca03181.i -quiet -dumpbas
e hello.cc -version -o /usr/tmp/cca03181.s
GNU C++ version 2.1 (80386, ATT syntax) compiled by GNU C version 2.1.
as -o hello.o /usr/tmp/cca03181.s
ld /lib/crt1.o /usr/local/lib/gcc-lib/i386-isc/2.1/crtbegin.o -L/usr/local/lib/
gcc-lib/i386-isc/2.1/ -L/usr/local/lib/ hello.o -lg++ -lgcc -lc -lg -lgcc /usr/l
ocal/lib/gcc-lib/i386-isc/2.1/crtend.o /lib/crtn.o
undefined first referenced
symbol in file
__vtbl__7filebuf /usr/local/lib/gcc-lib/i386-isc/2.1//libg++.
a
ld fatal: Symbol referencing errors. No output written to a.out
The problem is in iostream/stdstrbufs.C. Here's an excerpt from
that file describing the problem:
-----
// To avoid problems depending on constructor order (and for
// efficiency) the standard streambufs (and streams) are
// constructed statically using C-style '{ ... }' initializers.
// Since you're not allowed to do this for structs that
// have virtuals, we define fake streambuf and stream classes
// that don't have any C++-isms, and initialize those.
// To initialize the vtable field of the standard filebufs,
// we use the expression 'vt_filebuf' which must evaluate to
// (the address of) the virtual function table for the
// filebuf class.
----
Thanks to anyone who can help us with this linking problem.
Roger
Technical Details
Message-ID:
<1992Aug16.233357.17002@kong.gsfc.nasa.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!kong.gsfc.nasa.gov!sheldonReferences:
<1992Aug14.063108.21613@ulrik.uio.no>Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.lib.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!kong.gsfc.nasa.gov!sheldon From: sheldon@kong.gsfc.nasa.gov (Roger Sheldon - AISS) Subject: Re: Linker error on HP with libg++-2.2 Message-ID: <1992Aug16.233357.17002@kong.gsfc.nasa.gov> Sender: gnulists@ai.mit.edu Organization: Goddard Space Flight Center References: <1992Aug14.063108.21613@ulrik.uio.no> Distribution: gnu Date: Sun, 16 Aug 1992 23:33:57 GMT Approved: bug-lib-g++@prep.ai.mit.edu Lines: 61