Bad error message.
Alexander Zvyagin
zvyagin@gamspc7.ihep.su
Tue May 9 12:26:00 GMT 2000
Dear GCC developers,
here is my code with missing body of one method:
class A
{
public:
virtual void g(void); // There is no body for this method.
void f(void) {}
};
int main()
{
A a;
a.f();
}
Now I compile and link this program:
$ g++ a.c
/tmp/cczWb6Lx.o: In function `main':
/tmp/cczWb6Lx.o(.text+0x1d): undefined reference to `A::f(void)'
/tmp/cczWb6Lx.o: In function `A::A(void)':
/tmp/cczWb6Lx.o(.A::gnu.linkonce.t.(void)+0x8): undefined reference to `A
virtual table'
collect2: ld returned 1 exit status
But there is body for method A::f()!
It seems that g++ have to say that there is no method A::g().
I use gcc version 2.95.2 19991024 (release)
With best wishes,
Alexander Zvyagin.
More information about the Gcc-bugs
mailing list