Comment 2 for bug 305460

Revision history for this message
In , Debian GCC maintainers (debian-gcc) wrote :

class A {
    A();

    virtual void B();
};

A::A() {}
/* Whoops, I forgot to define A::B() */

$ g++ -Wall a.cc
/usr/lib/../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/ccaVlePI.o: In function `A::A()':
a.cc:(.text+0xf): undefined reference to `vtable for A'
collect2: ld returned 1 exit status

bug submitter writes:
"To be clear: the problem is that the error message only mentions the constructor, and the vtable. It doesn't mention the method A::B(), which is actually the problem. On a less-minimal example it could take much longer to work out what the real problem is."