This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bad error message.
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Bad error message.
- From: Alexander Zvyagin <zvyagin at gamspc7 dot ihep dot su>
- Date: Tue, 9 May 2000 23:26:50 +0400 (MSD)
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.