Question re:ClassDef


I have two classes: xEvent and fast. xEvent has a member variable which is an instance of the class fast. I want to serialize xEvent. Therefore, I put ClassDef’s in both the fast.h and xEvent.h files. However, when I try to link I get errors saying that there is an unknown vtable reference for fast and also for xEvent.

If I remove the ClassDef statement in fast.h then the linker does not complain. However, I am worried that when I serialize the data, the fast object won’t be written. Question: Do I need the ClassDef statement in both class headers (i.e., where one object includes an instance of another class) do I need the ClassDef statement. If so, what might be the problem with the linking?


Best Regards,



If you want to do I/O with your classes you need to generate a dictionary
using rootcint. Did you do it?
See chapter in the Users Guide about rootcint/Adding a class to teh dictionary.