# ClassDef Contradiction & Definition

**URL:** <https://root-forum.cern.ch/t/classdef-contradiction-definition/17617>\
**Category:** ROOT\
**Created:** [May 12, 2014, 9:35pm UTC](https://root-forum.cern.ch/t/classdef-contradiction-definition/17617 "2014-05-12T21:35:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfcaron](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/7c8e57/32.png) [@jfcaron](https://root-forum.cern.ch/u/jfcaron)\
**Post date:** [May 12, 2014, 9:35pm UTC](https://root-forum.cern.ch/t/classdef-contradiction-definition/17617/1 "2014-05-12T21:35:03Z")

</div>

This: [http://root.cern.ch/drupal/content/adding-your-class-root-classdef](http://root.cern.ch/drupal/content/adding-your-class-root-classdef) says to put ClassDef “somewhere” in your class definition.

This: [http://root.cern.ch/root/Using.html](http://root.cern.ch/root/Using.html) 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?

Jean-François

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 13, 2014, 6:32am UTC](https://root-forum.cern.ch/t/classdef-contradiction-definition/17617/2 "2014-05-13T06:32:01Z")

</div>

See [url][Simple way to create and merge shared libraries?](https://root-forum.cern.ch/t/simple-way-to-create-and-merge-shared-libraries/11652/6) for some additional neat Philippe’s notes concerning “ClassDef” / “ClassImp” / “TObject inheritance”.
