在使用虚函数的程序中,编译时会出现
undefined reference to `vtable for Class
或 undefined reference to typeinfo for Class
的情况
其解决方案就是将类似于
virtual void foo();
Should be defined (inline or in a linked source file):
virtual void foo() {}
Or declared pure virtual:
virtual void foo() = 0;