From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fredrik Öhrström To: "Martin v. Loewis" Cc: gcc@gcc.gnu.org Subject: Almost got glibc working with no-vtable-thunks, but .... Date: Thu, 30 Sep 1999 18:02:00 -0000 Message-ID: References: <199909142102.XAA00709@mira.isdn.cs.tu-berlin.de> X-SW-Source: 1999-09n/msg00627.html Message-ID: <19990930180200.3PD6jvAZk5cc7vG4Ewq-38pOpENQ-CrjLNxorWZFYkI@z> > This, in turn, could result from an incorrect contents of _G_config.h, > which explains the C++ vtable mechanism to C applications. You'll Found it. Everything seems to build correctly now. The generated files contains _vt. prefixes for the virtual tables instead of _vt_ I examined what the glibc "make check" command did to compile testprograms with the new library. With that information I managed to compile a single HelloWorld C program and link with the new library! :-) But when I try the following C++ program I get several link errors of this kind: /usr/local/gcc/lib/libstdc++.a.2.10.0(iostream.o): In function `_IO_ostream_with assign type_info function': /home/foh/Code/gccobjdir/i686-pc-linux-gnu/libio/../../../gcc-2.95.1/libio/iostr eam.h(.gnu.linkonce.t._._8iostream+0xc9): undefined reference to `__builtin_vec_delete' The program looks like this: #include #include struct Alfa { virtual int a() = 0; }; struct Beta : public Alfa { int a () { return 47; } }; int main() { printf ("Hello World!\n"); cout << "Hello World!" << endl; Beta b; return b.a(); } And the makefile looks like this: all: compile link compile: test.cc g++ test.cc -c -g -DNLSPATH='"/usr/local/glibc/share/locale/%L/%N:/usr/local/glibc/share/locale/%L/LC_MESSAGES/%N:/usr/local/glibc/share/locale/%l/%N:/usr/local/glibc/share/locale/%l/LC_MESSAGES/%N:"' -DHAVE_CONFIG_H -D_LIBC_REENTRANT -o test.o link: test.o gcc -nostdlib -nostartfiles -o test -Wl,-dynamic-linker=/usr/local/glibc/lib/ld-linux.so.2 /usr/local/glibc/lib/crt1.o /usr/local/glibc/lib/crti.o `gcc --print-file-name=crtbegin.o` test.o -Wl,-rpath-link=/usr/local/glibc/lib /usr/local/glibc/lib/libc.so.6 /usr/local/glibc/lib/libc_nonshared.a -lgcc `gcc --print-file-name=crtend.o` /usr/local/glibc/lib/crtn.o /usr/local/gcc/lib/libstdc++.a.2.10.0 (Sorry for the linebreaks...) What do I link in to find these rather important methods? I thought that earlier you had to explicitly link in -lg++ but now I can't find any library with that name. Thanks! Fredrik Ohrstrom