https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96283
Bug ID: 96283 Summary: "undefined vtable" error should indicate which members are missing Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eyalroz at technion dot ac.il Target Milestone: --- Consider the following code: class Base { public: virtual void vmethod(); }; class foo : public Base { int x; void vmethod() override; }; int main() { foo f; } This will yield the errors (irrelevant paths snipped): ld: prog.o: in function `Base::Base()': <source>:1: undefined reference to `vtable for Base' ld: prog.o: in function `foo::foo()': <source>:6: undefined reference to `vtable for foo' While this is true, it is a bit confusing. But even supposing I looked up what this error means and realized what was going on, I would still need to go over all the methods of one or two of the classes to find the one that's missing its implementation. In this simple example that's not so difficult, but sometimes it's quite the nuisance. I'm assuming the compiler provides the linker with enough information to realize which virtual methods' implementations are missing, so that the linker can finally print an error message which methods are still missing after it has run. In this specific case, the linker should complain about vmethod() missing its definition. GodBolt: https://godbolt.org/z/9Ejn4s