LCG dictionaries - Cintex in Cint and compiled programs

Hi Cint experts,

I have a problem trying to access the Reflex information contained in the LCG dictionaries in compiled programs. I give you a recipe to reproduce the problem with ROOT 5.26 (the myclass.h, classes_def.xml and myprog.cpp files are attached):

Generate the dictionaries for the class “myclass” and create a shared library:

genreflex myclass.h -s classes_def.xml -o -I $ROOTSYS/include
g++ myclass.h -o  `root-config --cflags --libs`  -lReflex -lCintex -shared

At this point, the class can be used in the cint interpreter with


And it works fine: both I/O (myclass inherits from TObject) and symbol lookup.

Then to compile and execute the program:

g++ myprog.cpp -o myprog.exe  `root-config --cflags --libs` -lReflex  -L ./ -lmylib

And I get a:

Error in TClonesArray::SetClass: called with a null pointer

I tried some solutions myself, and I removed the above error playing a bit with TCint, for example adding in my program:

TCint cint("cint","cint");

Beyond being more or less ugly, this patch does not solve the problem since if I then try a:

myclass o;

I get this output:
==> Dumping object at: 0x0902abc0, name=myclass, class=myclass

m_mymember 0
fUniqueID 0 object unique identifier
fBits 0x03000000 bit field status word

*** Break *** segmentation violation
Segmentation fault

Is anyone able to give the recipe to use LCG dictionaries in a shared library linked to a compiled program?



you need to create a TApplication object, not a TCint object. That should fix it.

Cheers, Axel