I am attempting to store a custom class in a TTree. The custom class has a stl::vector member of another custom class. After writing the tree, I open the file and try TTree::GetEntries(), which returns 0. Also, TTree::GetEntry() returns 0. However, if I use TTree::Print() I can see there are entries:
I’m using root version 4.00/08, on a linux box with gcc version 3.4.3. This version should correctly handle stl, right?
I suspect it may have something to do with stl, since the previous version of this code did not use stl and I had no problems. Or possibly with the dictionary?
I also tried adding a “+” to the #pragma link C++ class CustomClass+;
statement , but this does not help. (I previously did not have the “+”, but had no trouble.)
It is difficult to tell you more without seeing your class with STL.
However, note that a major upgrade of ROOT supporting STL collections was introduced in 4.02. I would strongly recommend to move to a newer version like 4.04 or better 5.04
If I ldd my executable (or any of my shared libs), I see no dependence on libNetx.so. I find it strange that I get this error in all of these ROOT versions, but not in 4.00.
I’ve attached a tarball with a simple executable (and Makefile) to illustrate this problem. When I compile with 4.00, everything runs fine. When I compile with 4.02 or higher, I see the relocation error.
Unfortunately, the file I accesssed is not open to the general public.
Is it possible that this problem comes about because I use a newer version of root than is running on the rootd server?