Dear all.
normally I don’t use ROOT or C++ in my work, but I have a C++ ROOT script I would like to use.
When I run the script with root script.cpp
it works correctly.
I created a header file which contains the function I want to call and compiled the C++ file into a library.
Then I call the whole thing using:
ROOT.gInterpreter.ProcessLine('#include "header.h"')
riccardoLib = ROOT.gSystem.Load('./Library.o')
ROOT.function()
The code runs fine up to a certain point when I get the following error:
python: symbol lookup error: /directory_of_the_script /Library.o: undefined symbol: _ZN4ROOT4Math12InterpolatorC1ERKSt6vectorIdSaIdEES6_NS0_13Interpolation4TypeE
I did some digging in the code to see where it crashes exactly and I found this function call to be the cause:
gMinuit->mnexcm("CALL FCN", arglist ,1,ierflg);
which is strange because before then the mnexcm function is already called (larger sniplet):
gMinuit->mnexcm("SET ERR", arglist ,1,ierflg);
for (UInt_t i=0;i<NDATA;i++){
Char_t str[10];
sprintf(str,"Ek%d",i);
minuit.mnparm(i,str, start[i], step[i], Efitmin,Efitmax, ierflg);
}
gMinuit->mnexcm("CALL FCN", arglist ,1,ierflg);
Hope you can help me fix this error.
In case you need it info on my System:
I have conda 4.8.3 with Python 3.7.8 installed and created a ROOT environment (Root 6.22/02) as described in the install guide. I am using Ubuntu 18.04.2.