`Undefined reference to `vtable for...'`
is usually a sign of unimplemented virtual function. Make sure you have implemented (defined) the corresponding virtual functions you inherited from the base classes.
For example this will give you the same error because the print method in B is not implemented.
class A {
public:
virtual void print() = 0;
};
class B : public A{
public:
void print();
};
int main()
{
B b;
}