Dynamic Linking Error

Hello Kind Root Helpers,
I am trying to produce a script which i can run interactively in ROOT which relies on some self made libraries and classes and some ROOT classes, but i am running into problems with dynamic linking.

For instance for my class defined in plotter.C i require 3 other classes emustream.h,mumustream.h and eestream.h, when i try to load and create a library for them individually using:

.L emustream.C+ it all works fine, but once the emustream_C.so is created when i try to run the same command again i obtain:

dlopen error: /home/anthony/software/root/lib/libTree.so: undefined symbol: _ZTI10TSQLResult
Load Error: Failed to load Dynamic link library /home/anthony/Documents/Physics/ssdileptons_2012/xstream/./emustream_C.so

Similarly for the other classes, now i can make the linking using:
.L emustream.C++ (this is a time consuming and brutal solution which does work)

As i understand with asingle + after the program root should not need to recompile if nothing has been modified.

However then when i try to compile .L plotter.C++ (which relies on the stream classes) this crashes out using:

dlopen error: /home/anthony/Documents/Physics/ssdileptons_2012/xstream/./plotter_C.so: undefined symbol: _ZN7plotter12create_fakesEiii
Load Error: Failed to load Dynamic link library /home/anthony/Documents/Physics/ssdileptons_2012/xstream/./plotter_C.so

Proceeded by a ton of undefined reference errors e.g.
/home/anthony/software/root/lib/libHist.so: undefined reference to ROOT::Fit::BinData::~BinData()' /home/anthony/software/root/lib/libTree.so: undefined reference toTSQLRow::Streamer(TBuffer&)’
/home/anthony/software/root/lib/libHist.so: undefined reference to ROOT::Fit::Fitter::DoLikelihoodFit(ROOT::Fit::UnBinData const&, bool)' /home/anthony/software/root/lib/libHist.so: undefined reference toTMath::Nint(double)’

And it is not loaded.

I can then restart ROOT load by brute force using:

Which is finally linked (and has all the stream classes linked to) in which case i can finally run my program:
.x analysis.cpp+ (which relies on the plotter.C class)

But whilst i have found a way around the problem, i would like to fix this. I don’t know if it is a question of how root is looking for the path, or the way things are linked, it seems by brute force root can find the libraries but looking by itself it cannot.

Thank you kindly for all help and advice!

Hello all,
Is there something i can make clearer or give more information to help others understand my problem to be able to solve it?


Which version of ROOT are you using? Can you try with with 5.34? If it fails with v5.34, can you provide a complete running example showing the problem?