Home | News | Documentation | Download

Load a standalone sharedlibrary


I have a a shared library


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


What if I work directly in the CLING interactive environment?


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


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



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.



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.



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.