My analysis code which uses list of root files (data) and creates Histograms on a canvas. The code was developed by group on OpenSUSE. When I copied the same code to my Ubuntu 12.04 laptop and tried to run it but it didn’t work. The problem is with default linking of Ubuntu (as I understand from previous communication in this forum).
I made a test by removing all need of TCanvas in the code and it worked without error. But I do not know how to solve this issue, I really need TCanvas. The main file of the code is attached (sorry, no stand alone code since i don’t know how to make it small).
Why are you putting the library several time in the link command ?
Are you ROOT library really in /usr/local/root/lib ?
Have you defined $ROOTSYS ?
Only TCanvas is causing problem ? The other ROOT objects you are using are fine ?
@ Couet
I didn’t put the libraries intentionally many times. Infact I am not good at coding, as long as it works, I do not bother. Here the code was working in OpenSUSE, I copied and tried to run in Ubuntu. I attach here the Makefile, just incase you want to have more hint.
Yes my root libraries are in “/usr/local/root/lib”
Defining $ROOTSYS , sorry no idea.
And yes, only TCanvas is creating problem, for example other things I defined are fine, TH2F and TGraph are working fine.
In file included from FBBAnal.cxx:2:
./FBBAnal.h:58:10: warning: 'FBBAnal::Init' hides overloaded virtual function [-Woverloaded-virtual]
void Init();
^
SOLVED: (simply linker issue of Ubuntu, we have to manualy link root libraries in order to solve such problem)
I simply added the $(LIBS) at the end of the line where “libFBBAnal.so” is mentioned (or created or linked… whatever is does there) in the Make-macro file. Make-macro is simply the Macro for Makefile.
NOTE that LIBS := $(shell root-config --libs) in my Makefile.