I have a class with a method analyzer in it. I am able to compile the code sucessfully(to make .so) but While running it in root session by the following command i get an error:
root  .L CL_LLR.so
root  CL_LLR p;
root  p.analyzer();
/home/sushil/ROOT_5.16/root_516/bin/root.exe: symbol lookup error: /home/sushil/Qstar_GammaJet/Analysis/200GeV/MassFit/2.5TeV/data/50GeV_LLR/Class_CL/./CL_LLR.so: undefined symbol: _ZN5TFileC1EPKcS1_S1_i
It seems something wrong with my TFile defintion in the .C or .h file but could not figure out what is wrong!!?
One can see my code at the following link:
schauhan.web.cern.ch/schauhan/B … /Class_CL/
Could anyone suggest some solution for it.
Thanks and with best,
do gSystem->Load(“libRIO”) before loading your library; your library depends on it so it must be available.
Thanks for your reply.
As you said that my library depends on "libRIO" and I need to load it. It means "libRIO" contain somthing which if I put in my lib then it should work without loading "libRIO".
If its trivial could you please tell what changes I should to my .C/.h so that I do not need to load "libRIO".
Thanks and with best,
One of the thing you need from libRIO is TFile, without it you will not be able to read anything from the ROOT file.
PS. To automate the loading of your libRIO you could also write a rootmap file named CL_LLR.rootmap and containing
Thanks for this discussion. I just upgraded from v4.04 to v5.18 to match the version my lab is using now, and I ran into this same problem. My libraries (libSomething.so) loaded and executed fine in the earlier version. FYI, another discussion I found on this topic is here: http://root.cern.ch/phpBB2/viewtopic.php?t=4778
I could not get the libSomething.rootmap method to work as described above. Where am I supposed to put the .rootmap file? $PWD?
I got my .so to load and execute by using .rootrc. Here is what I did:
I created the file ~/.rootrc and put this in it,
This tells ROOT to execute the file ~/.rootlogon at the beginning of a new session.
Next, I created the file ~/.rootlogon with this in it.
This will load the RIO library everytime a new root session is started. The .rootrc and .rootlogon can be placed in $PWD if you do not want libRIO.so loaded every time you start a new ROOT session.
My question: Is this method better, worse, or equivalent to the .rootmap method? Regardless, I would like to know how to use the .rootmap file as well. So if anyone can give me more details on how to use .rootmap, I would really appreciate it.
your method is worse because you load it every time you start ROOT, unconditionally. You would put the rootmap file into any LD_LIBRARY_PATH part.