This is the mail archive of the gcc@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: libstdc++ problems /w egcs-2.91.52 on sparc-linux?


Kevin Milans <kmilans@CapAccess.org> writes:

|> Hello,
|> 
|> 	After a clean build of egcs-2.91.52 from CVS on sparclinux, any 
|> linking with libstdc++ complains about an undefined reference to
|> `filebuf virtual table'.  I'm using GNU binutils v. 2.9.1 (with BFD 
|> 2.9.1.0.4).  For example, the file test.cc
|> 
|> #include <iostream.h>
|> 
|> int main (void)
|> {
|> 	cout << "Testing" << endl;
|> }
|> 
|> will not link correctly.  The output of g++ -o test test.cc is: 
|> 
|> /usr/lib/libstdc++.a(stdstrbufs.o)(.data+0x64): undefined reference to 
|>    `filebuf virtual table' 
|> /usr/lib/libstdc++.a(stdstrbufs.o)(.data+0xcc): undefined reference to 
|>    `filebuf virtual table'
|> /usr/lib/libstdc++.a(stdstrbufs.o)(.data+0x134): undefined reference to
|>    `filebuf virtual table'
|> collect2: ld returned 1 exit status
|> 
|> The same thing has happened with the egcs release 1.0.3a.  I'm a bit
|> confused because this happens for me for all versions of egcs on 
|> sparclinux, yet it seems a big enough problem that it should be 
|> either working or at least documented somewhere.

You are mixing object files that are compiled with -fvtable-thunks with
ones that are compiled without it.

|> Looking at this library with nm produces:
|> 
|> # nm /usr/lib/libstdc++.a | grep filebuf | grep vt
|>          U __vt_7filebuf
|>          U _vt.7filebuf 
|> 00000000 R __vt_7filebuf
|> #

Please try 

	nm /usr/lib/libstdc++.a | grep -e : -e 'vt.*filebuf'

so that the names of the offending object files are displayed.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org


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