Standalone program and ClassDef

Hi,

#include "TObject.h"
class myclass: public TObject
{
public:
  myclass();
  ClassDef(myclass,1); //error
};

int main()
{
  static myclass* a=new myclass();
  return 0;
}

myclass::myclass(){}

Compiling above code with “g++ root-config --libs -o test test.cc” gives an error:

/tmp/ccOJNZwA.o(.text+0xb3): In function myclass::myclass()': : undefined reference tovtable for myclass’
/tmp/ccOJNZwA.o(.text+0xd3): In function myclass::myclass()': : undefined reference tovtable for myclass’
collect2: ld returned 1 exit status

What am i doing wrong?

ok, I should call rootcint first.