Undefined reference to vtable

前端 未结 16 2440
死守一世寂寞
死守一世寂寞 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:14

    In my case I'm using Qt and had defined a QObject subclass in a foo.cpp (not .h) file. The fix was to add #include "foo.moc" at the end of foo.cpp.

提交回复
热议问题