Hello!
My problem is the following:
I have made a little program which uses a derivated class from TParticle. I compile this new class into a shared object called libHParticle.so. Then I create routines which makes operations with HParticle objects and I compile them into another shared library, called libSiguangTMC.so. Everything working OK!
Finally, when I want to make use of these libraries to make a program I get the following compilation errors:
g++ -g -O -Wall -fPIC -pthread -I/opt/products/root/5.14.00/include -I/afs/desy.de/user/d/delaossa/sTMC/test/../src/0607 -I/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle -I. -o run_sTMC_0607 run.C -L/afs/desy.de/user/d/delaossa/sTMC/test/../src/0607 -lSiguangTMC -L/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle -lHParticle -L/opt/products/root/5.14.00/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm -ldl -rdynamic
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::GetPDG(int)'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TDatabasePDG::Instance()'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::operator=(TParticle const&)'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::ShowMembers(TMemberInspector&, char*)'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::GetName() const'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `typeinfo for TParticle'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::Print(char const*) const'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `non-virtual thunk to TParticle::Sizeof3D() const'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::Sizeof3D() const'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::DistancetoPrimitive(int, int)'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::ExecuteEvent(int, int, int)'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::TParticle()'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::Paint(char const*)'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::GetTitle() const'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TDatabasePDG::GetParticle(int) const'
/afs/desy.de/user/d/delaossa/sTMC/test/../src/HParticle/libHParticle.so: undefined reference to `TParticle::~TParticle()'
collect2: ld returned 1 exit status
I have attached the program (sTMC.tgz). Just unpack, go inside sTMC dir and type make to compile. The libraries are built ok, but the running program in sTMC/test fails.
Now, the funny thing. I get this error using both ROOT 5.18 and 5.14. But if a change the ROOTLIBS variable defined in sTMC/test/Makefile in the usual way
ROOTLIBS := $(shell root-config --libs)
by this line
ROOTLIBS = -L/${ROOTSYS}/lib -lCint -lCore -lGpad -lGraf3d -lGraf -lGui -lHist -lMatrix -lPhysics -lTree -lEG -lRint -lTreeViewer -lm -ldl
It works using ROOT 5.14, but still crashing with 5.18. . Anyone can help, please?
Thank you.