I am relatively new to c++ and having an implementation like below:
class A {
virtual void func1() = 0;
};
class B : A {
void func1() override{
// imlement func1 here
}
virtual func2() = 0;
}
class C : B {
void func2() override{
// implement func2 here;
}
}
These classes are packaged as their own binaries and can be build individually.
B builds successfully, but when I build C, it gives an 'Undefined reference to vtable' error. To get rid of it, I have to implement func1() in C.
But for func1(), I want the implementation in B (because in my project, B is an existing legacy class) not in C. Is there a way to do it?
Thanks