Qt undefined reference to vtable [duplicate]

This is a subtle bug (and probably partly at least a compiler bug) that I’ve seen before. Since QWidget has a virtual destructor, the compiler needs a vtable for your class. But your class doesn’t have any virtual functions, so it didn’t build one for your Communicate class.

Add a virtual ~Communicate() {}; to your class, and all will be well.

Yes, it took me some time to figure this out too!

Leave a Comment