Loading a macro in ROOT6 with external ROOTified library

Hi,

I am trying to migrate to ROOT6. I find that things working out on ROOT5 have changed a little in ROOT6.

The question is that I have a ROOT-ified compiled library. Previously I had a macro.C and I could use the methods and classes inside the library by doing

Int_t myMacro( )
{
gSystem->Load(“libMyLibrary.so”);

myLibTools::MethodFromClassInLibrary(“libMyLibrary”);

}

Then it complains with something like

use of undeclared identifier ‘myLibTools’

The point is that when I enter in an interactive session. And I do

root -b
[0] gSystem->Load(“libMyLibrary.so”);
[1] myLibTools::MethodFromClassInLibrary(“libMyLibrary”);

It works perfectly!!

So, how can I prepare few script lines that will reproduce what I do in my ROOT session?

Try the R__LOAD_LIBRARY macro:

R__LOAD_LIBRARY(libMyLibrary)
Int_t myMacro( ) {
    // your code here
}

See older threads, for example Shared libraries and ROOT-6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.