collect2 / ld giving strange errors with undefined virtual functions

Martin v. Loewis martin@Mira.isdn.cs.tu-Berlin.de
Fri Mar 26 01:07:00 GMT 1999


> Yup.  But this error is impossible to detect within the compiler, and
> when we get to the linker, it's too late :-(

Would it be worth to introduce another linker feature here. GNU ld
already has the linker_warning: a message is printed whenever a
specific symbol definition is used. glibc uses it to warn about calls
to unreliable functions.

The feature I'm proposing is different: Whenever the linker ends up
with an undefined symbol, it will print a message like

undefined reference to `A virtual table'
There is no definition of `A::foo(int)'.

What do you think?

Martin



More information about the Gcc mailing list