This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bad error message.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]