I’m having a problem successfully generating a dictionary for a group of classes I’ve made. I’ve observed the same problem on Root Version 4.02/00 on cygwin, Version 3.05/07 on linux with KAI, and Version 4.00/08 with GCC. I can tell that the dictionary generation isn’t completely successful because 1) it complains when I load in the shared library and 2) when I use the shared library, I don’t get information for some of the classes.
Basically, I’ve got an bunch of first “generation” objects (once removed from TObject), and then second and third generation objects that derive from the first generation objects. When I compile, I get no error messages and a shared object library is successfully created. When I load that object into root, I get an error message saying some of my second and third generation objects don’t have dictionaries (while other second and third level objects do). I put a gzipped tar ball on the web so anybody can try this (Note: the makefile assumes you have one of the three above situations (cygwin, Kai on linux, or GCC on linux). If you don’t simply load Root’s makefile.arch and stick in your compiler flags into the makefile).
cplager@fcdflnx6> wget http://www-cdf.fnal.gov/~cplager/CLPClasses.tgz (stuff goes by) cplager@fcdflnx6> tar xzf CLPClasses.tgz cplager@fcdflnx6> mkdir shlib cplager@fcdflnx6> cd CLPClasses cplager@fcdflnx6> gmake (stuff goes by, but no errors) cplager@fcdflnx6> root -l root  gSystem->Load("../shlib/libCLPClasses") Warning in <TClass::TClass>: no dictionary for class CLPElectron is available Warning in <TClass::TClass>: no dictionary for class CLPMuon is available Warning in <TClass::TClass>: no dictionary for class CLPJet is available (int)0
It has no problem finding the dictionary for other classes (e.g. CLP3Vector, CLPChargedParticle).
O.k. So did I screw up the inheritence or root macros? I wrote a perl script to check this (in the same directory we were just in, ‘CLPClasses/’):
cplager@fcdflnx6> ./showRootClassDepend.pl Include file: CLP3Vector Included in LinkDef.h derives from: public TObject ClassDef (CLP3Vector, 1) // CLP 3 vector class ClassImp (CLP3Vector) Include file: CLP4Vector Included in LinkDef.h derives from: public TObject ClassDef (CLP4Vector, 1) // CLP 4 vector class ClassImp (CLP4Vector) Include file: CLPObject Included in LinkDef.h derives from: public TObject ClassDef (CLPObject, 1) // CLP Object class ClassImp (CLPObject) Include file: CLPJet Included in LinkDef.h derives from: public CLPObject ClassDef (CLPJet, 1) // CLP Jet Class ClassImp (CLPJet) Include file: CLPChargedParticle Included in LinkDef.h derives from: public CLPObject ClassDef (CLPChargedParticle, 1) // CLP Charged Particle Class ClassImp (CLPChargedParticle) Include file: CLPElectron Included in LinkDef.h derives from: public CLPChargedParticle ClassDef (CLPElectron, 1) // CLP Electron Class ClassImp (CLPElectron) Include file: CLPMuon Included in LinkDef.h derives from: public CLPChargedParticle ClassDef (CLPMuon, 1); // CLP Muon Class ClassImp (CLPMuon) Include file: CLPClasses Include file: CLPNamespace
The script complains if you mess up the name in either ClassDef or ClassImp. So everything inherits from either TObject or from CLPObject (or something that inherits from CLPObject). As far as I can tell everything looks fine. Note that CLPJet doesn’t have a successful dictionary, but that CLPChargedParticle does and they both inherit from CLPObject.
The rootcint command in the makefile only has the LinkDef.h file and CLPClasses.h (which has all other include files) in it.
$(ROOTSYS)/bin/rootcint -f src/$(DICT).C -c $(INCFLAGS) $(MAIN).h LinkDef.h
When I check the dictionary file by hand, I see entries for both CLPChargedParticles (which has a good dictionary) and CLPJets (which doesn’t).
What am I doing wrong?