a header file

class a : public TObject
{
public:
  A();
  virtual ~A() {};
}

Then I've got the linking error of g++ as follows:

undefined reference to `vtable for A'

The solution is to define the real destructor in source file.

a header file

class a : public TObject
{
public:
  A();
  virtual ~A();
}

a source file

A::~A()
{
}

posted by citadel
C++ is a horrible language. It’s made more horrible by the fact that a lot of substandard programmers use it, to the point where it’s much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C.
Linus


I am so glad, someone has the same feeling which I have now.
posted by citadel