# Adding a class: hand holding requested

**URL:** <https://root-forum.cern.ch/t/adding-a-class-hand-holding-requested/13893>\
**Category:** ROOT\
**Created:** [February 29, 2012, 4:39pm UTC](https://root-forum.cern.ch/t/adding-a-class-hand-holding-requested/13893 "2012-02-29T16:39:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [February 29, 2012, 8:05pm UTC](https://root-forum.cern.ch/t/adding-a-class-hand-holding-requested/13893/2 "2012-02-29T20:05:49Z")

</div>

On Linux, try (for MacOS and/or Windows, you need to find someone who can “transform” the commands given below):

``root-config --cxx --cflags` -fPIC -c MyClass.cxx
rootcint -f MyClass_Dict.cxx -c -p MyClass.hxx MyClass_LinkDef.h
`root-config --cxx --cflags` -fPIC -c MyClass_Dict.cxx
`root-config --cxx --cflags` -fPIC -shared -o libMyClass.so MyClass.o MyClass_Dict.o`  
The easiest way to try it is:

`root [0] .L libMyClass.so
root [1] .Class MySpace::MyClass1
root [2] .Class std::vector< MySpace::MyClass1 >
root [3] .Class std::vector< std::vector< MySpace::MyClass1 > >`  
See also [url][Simple way to create and merge shared libraries?](https://root-forum.cern.ch/t/simple-way-to-create-and-merge-shared-libraries/11652/1) for some additional neat Philippe’s notes concerning “ClassDef” / “ClassImp” / “TObject inheritance”.  
[MyClass.hxx](https://root-forum.cern.ch/uploads/default/original/2X/5/5be90c9c89e18e7d66b05d2cfc91eb1a1ac4c35c.hxx) (533 Bytes)  
[MyClass.cxx](https://root-forum.cern.ch/uploads/default/original/2X/4/4c2b2c7aa6fe210c8ed5b58b73ec0b6e48261d1b.cxx) (235 Bytes)  
[MyClass\_LinkDef.h](https://root-forum.cern.ch/uploads/default/original/2X/5/5e90987c70c3141a2a7ab991d7398b7399e09c09.h) (991 Bytes)

---

_[View the full topic](https://root-forum.cern.ch/t/adding-a-class-hand-holding-requested/13893)._
