Undefined symbol: _ZN6TChainC1EPKcS1_ in root 5.20

Hello,

Previously I was using root 5.14 and I tried to upgrade to 5.20. My code compiles fine, but when I try to load my *.so library I get the error:

dlopen error: /home/hodgkinson/EFlowAnalysis/tmp/libEFlowAnalysis.so: undefined symbol: ZN6TChainC1EPKcS1
Load Error: Failed to load Dynamic link library /home/hodgkinson/EFlowAnalysis/tmp/libEFlowAnalysis.so

I did not have this problem in 5.14. I read the release notes for newer versions, but could find any obvious reason why this no longer works except a suggestion to compile with the option root-config --libs (which makes no difference to the problem…). Does someone know what might have changed I need to take into account?

Thanks,

Mark

Hi Mark,

You should try too link with libTree (add -lTree to your linker options)

Cheers, Bertrand.

[quote=“bellenot”]Hi Mark,

You should try too link with libTree (add -lTree to your linker options)

Cheers, Bertrand.[/quote]

Doesnt seem to make a difference…but this gave me the idea to try:

gSystem->Load(“libTree”);

before loading my library and the error goes away. Now I get:

undefined symbol: _ZN7TCanvasC1Eb

Is there some webpage that gives a map from each rootclass to the relevant library to load (I dont see a libCanvas or libTCanvas) - otherwise one would spend a lot of time to figure out which library is needed?

Cheers,

Mark

I don’t understand, since explicitely linking your library with libTree is basically the same than calling gSystem->Load(“libTree”) before loading your library…
And linking your library with root-config --libs should solve this kind of issues… (just try to type root-config --libs on the command line to see the list of libraries)

BTW: TCanvas is in libGPad, and you will probably also need libGui…

Bertrand.

[quote=“bellenot”]I don’t understand, since explicitely linking your library with libTree is basically the same than calling gSystem->Load(“libTree”) before loading your library…
And linking your library with root-config --libs should solve this kind of issues… (just try to type root-config --libs on the command line to see the list of libraries)

BTW: TCanvas is in libGPad, and you will probably also need libGui…

Bertrand.[/quote]

ok that is a bug in my makefile then :slight_smile: I should be able to find which other libraries I need then

Thanks for the help

Mark