Home | News | Documentation | Download

Load a standalone sharedlibrary


#1

I have a a shared library

$PROJECT/lib/libCustomClass.so

How can I use it in CLING?


Unresolved while linking
#2

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


#3

What if I work directly in the CLING interactive environment?


#4

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


#5

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


#6

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


#7

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.


#8

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


#9

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