Confused on adding a class to root

From: Emanuel Machado <Emanuel-Machado_at_cytonome.com>
Date: Mon, 16 Jun 2008 11:30:57 -0400

 

Hello,  

I am having trouble getting the ClassDef and ClassImp macros to work as I try to add a class to root. I'm compiling code using the libraries, on root 5.19/04 which I recently upgraded from 5.12. My system is running Fedora Core 5, and generally I have had no problems compiling/running code.  

This, however, is the first time I attempt to add a class to root. In a way, since I run compiled code, I wonder if I have to in order to derive from TObject and pass objects through the TSocket mechanism, but this is my current understanding of it. Prequestion: are the macros only meant to be used while under a root session/CINT?  

So I attempted to follow the instructions in http://root.cern.ch/root/Using.html ("Adding Your Own Classes to Root"), and examined the TLine example, so I added ClassDef to the class definition and ClassImp to the class implementation files.  

What I notice is that if I comment those statements, I get a good compilation (note that I'm not yet at the point of actually using this), but if I don't, I get linking errors pointing to some undefined references that I would have assumed should have been dealt with by the macros.  

I include the combined files as an attachment (text and files if you want to try to reproduce this)  

Thanks in advance for your comments,  

Emanuel  


Emanuel Machado, PhD.

Senior Engineer, Project Leader      

Cytonome, Inc.

27 Drydock Ave

Boston, MA 02210

Voice: (617) 330-5030 ext. 237

Fax: (617) 330-5031

Website: www.cytonome.com  

Email: Emanuel-Machado_at_cytonome.com    

image001.jpg
Received on Mon Jun 16 2008 - 17:31:09 CEST

This archive was generated by hypermail 2.2.0 : Mon Jun 16 2008 - 23:50:02 CEST