Go to the first, previous, next, last section, table of contents.

Linker complains about missing virtual table

"I'm getting a message complaining about an undefined virtual table. Is this a compiler bug?"

(On platforms that run neither collect nor the GNU linker, like Solaris, you may see an odd undefined symbol like "_vt.3foo", where foo is a class name).

This is probably because you are missing a definition for the first (non-inline) virtual function of the class. Since gcc-2.7.0, g++ uses a trick borrowed from cfront: the .o file containing the definition for the first non-inline virtual function for the class will also contain the virtual function table.


Go to the first, previous, next, last section, table of contents.