Undefined reference to vtable

前端 未结 16 2514
死守一世寂寞
死守一世寂寞 2020-11-21 20:30

When building my C++ program, I\'m getting the error message

undefined reference to \'vtable...

What is the cause of this probl

16条回答
  •  清歌不尽
    2020-11-21 21:26

    Not to cross post but. If you are dealing with inheritance the second google hit was what I had missed, ie. all virtual methods should be defined.

    Such as:

    virtual void fooBar() = 0;
    

    See answare C++ Undefined Reference to vtable and inheritance for details. Just realized it's already mentioned above, but heck it might help someone.

提交回复
热议问题