Loading a shared library into Root

Hi!

I linked several classes into a shared library. When I try to load it into Root 5.20.00 with .L libkdbcommon.so I run into some trouble.
If I have linked the library together with the libraries I get from root-config --libs I get a bunch of warnings likeWarning in <TClassTable::Add>: class TFile already in TClassTable and when I quit from Root it segfaults.
If I haven’t linked the Root libraries in, Root complains about missing symbols which can be fixed by

gSystem->Load("libNet"); gSystem->Load("libThread");
When I quit, Root does NOT segfault in that case.

So, my question is: How I am supposed to compile my classes into a shared library? I would like to load them into Root as easy as possible. Can you please give me some advice on this?

Regards,
Sebastian

[quote]If I have linked the library together with the libraries I get from[/quote]Don’t!

[quote]So, my question is: How I am supposed to compile my classes into a shared library? I would like to load them into Root as easy as possible. Can you please give me some advice on this? [/quote]You will need to either load the (missing) dependent library by hand or write a rootmap file::# File libnbROOT.rootmap Library.MyClassName: libThread.so libNet.so or use the rlibmap utility to genereate it based on your linkdef.h file

Cheers,
Philippe

Thank you! .rootmap files did the trick for me.