Root-config, libTreePlayer and TTreeIndex

Hi,

I ran into a problem today where I was trying to load a TTreeIndex from a .root file. With a compiled program, when I attempted this, I got the error:

Error in TKey::ReadObj: Unknown class TTreeIndex

Although it would work ok from interactive root.

After some putzing around I found that if I added

-lTreePlayer

to my linking command, then the compiled program would be able to load TTreeIndex.

So I guess my question is, how come my call to

root-config --libs

which I use in my makefile, doesn’t pick up -lTreePlayer. For ref, here is what I do get:

-L/usr/local/lib/root -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm -ldl -rdynamic

I’m on 5.16/00 - which I appreciate is not the newest kid on the block - so if this has already been addressed and fixed then apologies.

cheers
peter

This was a problem in 5.16. It is solved in newer versions.
With 5.16 before loading your Tree, do

gSystem->Load("libTreePlayer");
or , if you link your own executable, link with -lTreePlayer

Rene

thanks!