ClassDef Contradiction & Definition

This: says to put ClassDef “somewhere” in your class definition.

This: claims that ClassDef MUST be the last line of your class definition. It’s even in bold text. I know that page is old, but it’s what comes up on Google when I search for how to add my own class to ROOT.

Furthermore, these two pages seem to have a different understanding of the meaning of “definition” than me. I thought the declaration is the stuff that typically goes into a .h file, while the definition == the implementation and goes in a .C/.cxx file. Which do they mean? What do I do if I don’t separate my code into .h/.C but just have a simple .C file, will putting ClassDef there work properly?


See [url]Simple way to create and merge shared libraries? for some additional neat Philippe’s notes concerning “ClassDef” / “ClassImp” / “TObject inheritance”.