> > can reproduce "undefined reference to `vtable for GraphEngine'"
> > on Linux (2.6.18) with fltk-2.0.x-r5990
> > commenting the destructor works !!!!
> Indeed it does... There is something about destructors and such...
> Anybody? I used to know this stuff...
IIRC, there are two basic C++ problems here:
1. You have declared a public destructor for GraphEngine, but you have
not actually defined one. This would normally lead to an undefined
reference to ~GraphEngine, which would then be obvious, but...
2. GraphEngine is derived from GlWindow which is derived from Window
and Window has a virtual destructor, and it is this that leads to
the confusing vtable error message that you see.
Try the example below, both with and without the virtual keyword in
front of the combined declaration/definition of the Base destructor.
Cheers
Duncan
class Base {
public:
Base() {};
virtual ~Base() {};
};
class Test : public Base {
public:
Test();
~Test();
int data;
};
Test::Test()
{
this->data = 1;
}
int main(int argc, char* argv[])
{
Test t;
return 0;
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk