# Class created by MakeClass() won't load because "error: invalid use of non-static data member"

**URL:** <https://root-forum.cern.ch/t/class-created-by-makeclass-wont-load-because-error-invalid-use-of-non-static-data-member/32864>\
**Category:** Newbie\
**Created:** [February 22, 2019, 3:18pm UTC](https://root-forum.cern.ch/t/class-created-by-makeclass-wont-load-because-error-invalid-use-of-non-static-data-member/32864 "2019-02-22T15:18:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Day](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@Day](https://root-forum.cern.ch/u/Day)\
**Post date:** [February 22, 2019, 3:18pm UTC](https://root-forum.cern.ch/t/class-created-by-makeclass-wont-load-because-error-invalid-use-of-non-static-data-member/32864/1 "2019-02-22T15:18:37Z")

</div>

So I have tree called “Delphes” and I load the libEvent.so library and do tree-\>MakeClass(). This creates the class and header files with the same name as the tree. If I then attempt to load the “Delphes.C” I get many “error: invalid use of non-static data member” errors, for all the variables used as array length.

I understand how to solve this error (add static before the variable definition), but it’s the first error of many and I suspect MakeClass() should make something that works (or at least loads) out the box?

Root is running in a singularity, the tree is the default one created by the madgraph tutorial. Attached is a full log of the process, it contains a few other warnings that may be related. [MakeClass\_error.log.txt](https://root-forum.cern.ch/uploads/default/original/3X/e/8/e85b08afaf8e65515c21d64178770cf3b6ebebe0.txt) (8.5 KB) it formats correctly if read with cat/head/tail.

Any pointers on where I should be looking for the ‘root’ cause of this problem?

---

<div class="post-metadata">

**Author:** ![Day](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@Day](https://root-forum.cern.ch/u/Day)\
**Post date:** [February 22, 2019, 3:51pm UTC](https://root-forum.cern.ch/t/class-created-by-makeclass-wont-load-because-error-invalid-use-of-non-static-data-member/32864/2 "2019-02-22T15:51:36Z")

</div>

Oh, Just updated the version of root from 6.06.08 to 6.14.06 and the error is gone. (Replaced with warnings, but if they prove a problem I will make a different question.)

Problem solved.
