[PR42540] c++ error message [vtable undefined] is unhelpful
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Confirmed
|
Wishlist
|
|||
gcc-defaults (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
I've had response to g++ crash reports, so maybe you'd also like to know about this confusing error message I found.
Thanks!
Alan
This is on an up-to-date install of "Ubuntu 8.04.1".
apt-cache policy gcc
gcc:
Installed: 4:4.2.3-1ubuntu6
Candidate: 4:4.2.3-1ubuntu6
Version table:
*** 4:4.2.3-1ubuntu6 0
500 http://
100 /var/lib/
4:
500 http://
Minimal test program:
class A {
A();
virtual void B();
};
A::A() {}
/* Whoops, I forgot to define A::B() */
Actual error message:
/usr/lib/
(.text+0x20): undefined reference to `main'
/tmp/cc8P2uDq.o: In function `A::A()':
test.cpp:
/tmp/cc8P2uDq.o: In function `A::A()':
test.cpp:
collect2: ld returned 1 exit status
Expected error message:
Something more like "undefined reference to A::B()"
summary: |
- c++ error message [vtable undefined] is unhelpful + [PR42540] c++ error message [vtable undefined] is unhelpful |
Changed in gcc: | |
status: | Unknown → New |
Changed in gcc-defaults (Ubuntu): | |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in gcc: | |
status: | New → Invalid |
Changed in gcc: | |
status: | Invalid → In Progress |
Changed in gcc: | |
importance: | Unknown → Wishlist |
Changed in gcc: | |
status: | In Progress → Confirmed |
tags: | removed: needs-upstream-report |
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.