[omniORB] Undefined symbol "__pure_virtual"

Sai-Lai Lo S.Lo@uk.research.att.com
27 Jul 2000 10:48:48 +0100


This should not be necessary if gcc is built correctly on the platform as
-lgcc is automatically inserted by the compiler at link stage.

For example, compiling a hello world program on linux, notice the -lgcc
flag is among a whole list of -l flags produced by the compiler.

Please ask the freebsd maintainer to correct the problem with the gcc
installation. 

% g++ -v -o hello hello.cc
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cpp -lang-c++ -v -undef -D__GNU
C__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D_
_i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix 
-D__i386 -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Am
achine(i386) -Di386 -D__i386 -D__i386__ -D__tune_i386__ hello.cc /tmp/cchjBxxd.i
i
GNU CPP version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386 Linux/ELF
)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++-2
 /usr/local/include
 /usr/i386-redhat-linux/include
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cc1plus /tmp/cchjBxxd.ii -quiet
 -dumpbase hello.cc -version -o /tmp/ccKN9L3h.s
GNU C++ version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386-redhat-li
nux) compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
 as -V -Qy -o /tmp/ccK90etn.o /tmp/ccKN9L3h.s
GNU assembler version 2.9.1 (i386-redhat-linux), using BFD version 2.9.1.0.24
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/collect2 -m elf_i386 -dynamic-l
inker /lib/ld-linux.so.2 -o hello /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-l
ib/i386-redhat-linux/egcs-2.91.66/crtbegin.o -L/usr/lib/gcc-lib/i386-redhat-linu
x/egcs-2.91.66 -L/usr/i386-redhat-linux/lib /tmp/ccK90etn.o -lstdc++ -lm -lgcc -
lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/crtend.o /usr/lib/crtn.
o


>>>>> Peter van Heusden writes:

> On Wed, 26 Jul 2000, Lutz Bichler wrote:
>> Hi, 
>> 
>> i had the same problem and "solved" it by adding "-lgcc_pic" after $(LIBS) 
>> to the "Make rules for FreeBSD" in src/tools/omniidl/cxx/dir.mk. After 
>> deleting the _omniidlmodule.* files in lib/i586_freebsd_4.0 and recompiling 
>> it seems to work fine. 

> Hi

> Thanks for the tip. I discovered that -lgcc also works - the symbol is
> defined in libgcc, libgcc_pic, libgcc_p, libgcc_r and
> libgcc_r_p. Apparently the symbol is used in some way by the compiler
> internals when implementing pure virtual methods. (I found a message
> describing a virtual function table having an entry of __pure_virtual -
> maybe __pure_virtual is a placeholder symbol which is used till the actual
> method to be called is resolved. I don't know enough about C++ to be
> certain)



-- 
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.com 
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND