# Warning in \<MyClass\>: The data members of MyClass will not be stored, because it inherits from TObject but does not have its own ClassDef

**URL:** <https://root-forum.cern.ch/t/warning-in-myclass-the-data-members-of-myclass-will-not-be-stored-because-it-inherits-from-tobject-but-does-not-have-its-own-classdef/43597>\
**Category:** ROOT\
**Tags:** cling\
**Created:** [February 18, 2021, 1:25pm UTC](https://root-forum.cern.ch/t/warning-in-myclass-the-data-members-of-myclass-will-not-be-stored-because-it-inherits-from-tobject-but-does-not-have-its-own-classdef/43597 "2021-02-18T13:25:43Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [February 18, 2021, 10:20pm UTC](https://root-forum.cern.ch/t/warning-in-myclass-the-data-members-of-myclass-will-not-be-stored-because-it-inherits-from-tobject-but-does-not-have-its-own-classdef/43597/8 "2021-02-18T22:20:12Z")

</div>

Well having a LinkDef let you control more carefully what the dictionary does and would give you an opportunity to suppress the warnings.

Alternatively you could try a relatively new alternative (so you mileage may vary) and remove the dictionary generation altogether and add a `ClassDefInline` macro (instead of the `ClassDef` macro).  
If it works in you case, it will simply your build while still letting you use forward declaration.

Cheers,  
Philippe.

---

_[View the full topic](https://root-forum.cern.ch/t/warning-in-myclass-the-data-members-of-myclass-will-not-be-stored-because-it-inherits-from-tobject-but-does-not-have-its-own-classdef/43597)._
