ROOT v6.02 TCling::RegisterModule pcm dictionnary

Dear all,

I need to write a vector of a user-defined “Particle” class in a TTree.

My code was working well in ROOT v5.34, so I already have the “VectorParticle_LinkDef.h”, the “ClassImp(Particle)” in the “Praticle.cpp” and the “ClassDef(Particle, 1)” in the “Particle.hpp”. I also have a separate header for “VectorParticle.hpp” which includes and “Particle.hpp”.

My tree was well fed with the Particle class and I could access all the members in a TBrowser. Now with ROOT v6.02 I get the following messages when running my code :

Error in <TCling::RegisterModule>: cannot find dictionary module Dictionary_rdict.pcm Warning in <TTree::Bronch>: Using split mode on a class: Particle with a custom Streamer

I have a dictionary folder in which a “Dictionary_rdict.pcm” file is created, and I have also noticed that I had a “VectorParticle_LinkDef_rflx_rdict.pcm” file in my “include” folder. I have tried to move them to the folder where the executable is, and even though the TCling message disappears, the TTree seems somewhat broken and I don’t see any member of the particle class. When clicking on the “Particle” object in the TBrowser I receive tenths of error messages of the following sort:

Error in <TBufferFile::CheckByteCount>: object of class vector<Particle> read too few bytes: 18 instead of 138

Many thanks in advance for your help,

So I have eventually found a solution. I am not sure why it works without it in ROOT v5.34, but for ROOT v6.02 I had to create a dynamic library.

This implies:

  1. To add the Position Independant Code flag when compiling all the objects for the dynamic library:
  1. To compile the library with the right dependencies and only the right dependencies (if there is one too many ROOT complains when loading the library that some Streamer/Buffer/TTree methods are not defined):

[code]SOFLAGS = -shared

$(MYLIBRARY):$(ODIR)/Dictionary.o $(ODIR)/MyClass1.o $(ODIR)/MyClass2.o
$(CXX) $(SOFLAGS) $^ -o $@[/code]

=> this creates “” for instance

  1. To check where the “Dictionary_rdict.pcm” is created (normally it is created where the “Dictonary.cpp” file is. Make sure that the executable knows where the “.pcm” file is. Make sure that the shared library “” is also in the same folder as the “.pcm” file (which is newly created in ROOT v6.02). (It is simpler to move everything to where the executable is).

  2. To execute the code.

  1. To open the created file which contains the TTree of user-defined objects and to load the shared library “”: