Hi,
in the olden days of ROOT5 I developed a way of using scripts that combines the advantages of scripts with compiled stuff. Basically, I have a driver script which is interpreted, and loads all the necessary stuff, and it then compiles and executes the script proper. A typical driver script looks like this:
[code]void
phasespace()
{
Int_t error;
gROOT->ProcessLine(".x compasspub.C");
gROOT->ProcessLine(".L labelPlot.C+");
gROOT->ProcessLine(".L …/…/work/results/PAWstring.C+", &error);
if (error != TInterpreter::kNoError)
{
cerr << “couldn’t load PAW string library” << endl;
return;
}
gROOT->ProcessLine(".L …/…/work/results/WaveExplorer.C+", &error);
if (error != TInterpreter::kNoError)
{
cerr << “couldn’t load WaveExplorer library, error: " << error << endl;
return;
}
gROOT->ProcessLine(”.L mainPS.C+", &error);
if (error != TInterpreter::kNoError)
{
cerr << “couldn’t load main library” << endl;
return;
}
mainPS("…/…/res_pi03pi_dima/hfit_Dima_int_widen_2.root",
"…/…/res_pi03pi_dima/sfit.dat",
"…/…/res_eta3pi_widen_int/hfit_spin56_0++.root",
"…/…/res_eta3pi_widen_int/sfit_spin56_0++.dat",
"_noshift");
}
[/code]You see that it compiles and loads a number of utility libraries and then executes a function from one of them.
With ROOT6 this works the first time I run the script (I always start a new root instance from the command line, i.e., I run ‘root phasespace.C’ from my shell), but at the second invocation I get an error:
[code]Processing phasespace.C…
Using COMPASS style from compasspub.C
couldn’t load WaveExplorer library, error: 1[/code]
Deleting …/…/work/results/WaveExplorer.so allows me to run again. The bug only seems to affect WaveExplorer.C (which uses some ROOT GUI libraries, and which compiles without errors or warnings), but the only information I can give you is the return code printed above. If there’s any way I could give you more useful information for debugging, please let me know.