# Redefinition of class

**URL:** <https://root-forum.cern.ch/t/redefinition-of-class/36712>\
**Category:** Newbie\
**Created:** [November 6, 2019, 1:31pm UTC](https://root-forum.cern.ch/t/redefinition-of-class/36712 "2019-11-06T13:31:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![schniefen](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/74df32/32.png) [@schniefen](https://root-forum.cern.ch/u/schniefen)\
**Post date:** [November 6, 2019, 1:31pm UTC](https://root-forum.cern.ch/t/redefinition-of-class/36712/1 "2019-11-06T13:31:52Z")

</div>

Consider the attached file. Everytime compiling another script where `#include "MyClasses.C"` is inserted at the top, a redefinition error occurs. Could there be something erroneous about the way `ClassDef` and `ClassImp` are applied in the script?

[MyClasses.C](https://root-forum.cern.ch/uploads/short-url/52cXnOippYndQdi9uavsbsYmgNZ.C) (273 Bytes)

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [November 6, 2019, 2:49pm UTC](https://root-forum.cern.ch/t/redefinition-of-class/36712/2 "2019-11-06T14:49:43Z")

</div>

Add at the beginning of your file

```auto
#ifndef MyClasses_C
#define MyClasses_C

```

and at the end

```auto
#endif

```

without this each time you have the interpreter see #include “MyClasses.C” it will define ‘yet-again’ the class.
