Suggested FAQ entry
Doug Semler
doug@seaspace.com
Sat Apr 10 19:29:00 GMT 1999
This should probably be a FAQ entry, we wasted eight man hours tracking
this problem down, and AFAICT it isn't anywhere to be found in the docs or
the FAQ, if I missed it, please tell me :)...
Problem:
C++ classes exist which declare virtual functions in the header files,
and define them in source modules. Link errors occur when linking
stating that constructors and virtual tables are undefined.
Cause:
The first virtual function declaration in the class is never defined in
any of our source modules (due to interface changes, etc).
It was previously defined, but no longer. Therefore, the virtual
table/ctor/dtor definitions are never emitted.
Solution:
Make sure there exists a definition for all virtual functions
declared in the header file - especially the first one declared (and not
defined in the class declaration) - even if the functions are never used.
---
Doug Semler | doug@seaspace.com
SeaSpace Corporation | Garbage In -- Gospel Out
Least Senior Software Developer; | Minister of things to do Next Quarter
Low Man on the Totem Pole | (but will Never Be Done) DNRC O-
A closed mind is a terrible thing | Bus Error (passengers dumped)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/M d---(pu) s++:- a-- C++ UILSH+++$ P--- L++ E--- W+
N++ o-- K? w--(++$) O- M-- V- PS+ !PE Y PGP t(+) 5+++ X+
R- tv+(-) b+(++) DI++++ D G e++>++++ h!>--- r% y+>+++++**
------END GEEK CODE BLOCK------
More information about the Gcc-bugs
mailing list