Mail Archives: djgpp/1997/06/24/13:21:43
I'm using gcc version 2.7.2.1
Essentially what I have is a link error on an inheritance-based
system. I have class A which defines two abstract virtual functions,
class B (which actually does nothing) inheriting from A, and class
C inherits from B and implmenets the two virtual functions.
When I compile (gcc -g -ansi -Wall -fhandle-exceptions -c *.cc)
everything is fine. When I link (gxx *.o -lfl -lm), I get the
following error:
C.o: In function `C::C(char *)':
C.cc:91: undefined reference to `C virtual table'
I've checked the header files -- textbook C++, quite simple
actually. The C.cc file has the following at line 91:
C::C(char* name) : B(name)
{
}
Now, I do have both abstract functions redeclared (correct
name, return types, and signatures), but only one of them
implmemented in the .cc file -- the other one isn't being
called (if it were, the linker should show that anyway).
I've never seen a link error like this before... any
suggestions? (I'd be willing to provide the actual source
code and makefiles on request.)
Thanks in advance,
Kevin
--
Kevin M. Krom kevin DOT krom AT cs DOT cmu DOT edu
Master of Software Engineering http://www.cs.cmu.edu/~kmkrom/
Carnegie Mellon University +1 (412) 268-8423
- Raw text -