[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to resolve Undefined Symbol: typeinfo for ....?

From: address@hidden
Subject: How to resolve Undefined Symbol: typeinfo for ....?
Date: 28 Mar 2007 09:47:57 -0700
User-agent: G2/1.0

In my development I periodically get linking errors of the form:
"undefined symbol: typeinfo for MyClass".

I understand from previous researching that the cause of this is that
the compiler emits the typeinfo (and vtable info) attached to the
implementation of a chosen virtual method declared by the class.  If
that method isn't implemented, then the typeinfo and/or vtable doesn't
actually get implemented either, and the whole mechanism goes
kablooey.  The lesson to be learned here is to always implement all
declared virtual methods.

The problem I'm running into is that I believe I have done so.  I have
implementations for every method declared in the class, and I'm
getting this link error.

Is there any way to find out what method g++ is expecting to have the
typeinfo attached to?

(curiouser, doing "nm -C" on the resulting .so file is showing a value
in the symbol table for "typeinfo for MyClass", yet it is failing when
linking at runtime).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]