I have created a simple macro test.C using MakeClass method doing some plots. However, when I run it using commands:
.L test.C
test m
I get the following error:
IncrementalExecutor::executeFunction: symbol ‘_ZN14TLorentzVectorC1Ev’ unresolved while linking function ‘_GLOBAL__sub_I_cling_module_113’!
You are probably missing the definition of TLorentzVector::TLorentzVector()
Maybe you need to load the corresponding shared library?
I have searched for the shared library libPhysics.so that TLorentzVector needs, its found in rootbuild/lib directory, I tried to load it with various methods as:
gSystem->Load("/SGE/HEP/root/lib/libPhysics.so");
or in macro by,
R__LOAD_LIBRARY(libPhysics)
but, either non of the two methods works and I get the same error.
More info:
Platform: Centos7
ROOT_version: root-6.18.04
Delphes_version: Delphes-3.4.2 (used for creation of input data root file)
Actually, as a new user to root forum I couldn’t upload my macro.
Thanks a lot, I have tried this and it works, but I had another problem with loading libDelphes. I defined it in macro as : R__LOAD_LIBRARY(/home/aya/programs/Delphes-3.4.2/libDelphes) before all includes, but it gives an error :
input_line_9:1:10: fatal error: ‘/home/aya/programs/Delphes-3.4.2/libDelphes’ file not found
despite the shared library location is true and exists in specified location. I also, tried to load it using gSystem->Load(libDelphes); , but I get the following errors:
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTreeReader.h
requested to autoload type ExRootTreeReader
and many others related to ExRootAnalysis, despite I set its directory path in .bashrc file as : export ROOT_INCLUDE_PATH=/home/aya/programs/Delphes-3.4.2/external/ExRootAnalysis/
I tried both methods but, unfortunately, I am getting the same result. I also tried to define those variables in .bashrc file, which may be the same as the above method as:
The ROOT_INCLUDE_PATH needs to point to where ExRootAnalysis/ExRootTreeReader.h is - you have a duplicate ExRootAnalysis/ in there. I.e. I expect this to work with ROOT_INCLUDE_PATH=/home/aya/programs/Delphes-3.4.2/external:/home/aya/programs/Delphes-3.4.2/classes/ (your second export replaces the first one!)