Load a standalone sharedlibrary

I have a a shared library

$PROJECT/lib/libCustomClass.so

How can I use it in CLING?

Add R__LOAD_LIBRARY($PROJECT/lib/libCustomClass.so) somewhere at the top of your file, like in https://root.cern.ch/doc/v610/copytree_8C.html

1 Like

What if I work directly in the CLING interactive environment?

Then run gSystem->Load("$PROJECT/lib/libCustomClass.so"); command.

1 Like

How can I tell root where to look for header files referenced in the library?

Hi,

the information about headers is in the dictionaries. If you did not run dictionaries, you need to include the necessary headers with the usual preprocessor include directive.

D

What do you mean by “run dictionaries”? Can you give an example?
The include directive is included e.g.

#include “interface/classA.hh”

but CLING does not know where the folder interface is located.

Hi,

if you are in ROOT (I make this Ansatz since you posted in the ROOT category), you can instruct the tool about the headers location via the ROOT_INCLUDE_PATH environment variable, which can be formatted as LD_LIBRARY_PATH.

Cheers,
D

1 Like

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