Error when using gSystem->Load

Hi, i’m currently following an online tutorial with root and unfortunately i’ve come to a confusing point. Whenever I use

TTree t("t","a simple Tree with class");

 gSystem->Load("particle_CLASS_h.so");

I get the following error

Error in <TMacOSXSystem::FindDynamicLibrary>: particle_CLASS_h.so does not exist in /opt/local/libexec/root6:/opt/local/libexec/root6::/opt/local/libexec/root6:::.:/opt/local/libexec/root6/lib/root::/usr/local/lib:/usr/X11R6/lib:/usr/lib:/lib:/lib/x86_64-linux-gnu:/usr/local/lib64:/usr/lib64:/lib64:
Help?

Hi,

is the library available and in one of the directories of the LD_LIBRARY_PATH?

Cheers,
Danilo

Sorry for the late response, i’m not entirely sure how i would go about figuring out how to find out what libraries are available (new to mac), how would I do that?

Hi,

is particle_CLASS_h.so in the LD_LIBRARY_PATH or in the DYLD_LIBRARY_PATH ?
For more information about these environment variables, see for example
unix.stackexchange.com/questions … brary-path
stackoverflow.com/questions/3146 … -library-s

D

How would i see which part of this directory the file needs to be in? Currently the whole path is like 5 different directories and i’m not entirely sure where I would have to put the files to allow root to see them. Is it possible I have set up my dynamic library path improperly?

Yes, it is.
You’ll have to check that the path of the location of particle_CLASS_h.so is present in the LD_LIBRARY_PATH.

Cheers,
D

Try sth like:

CUSTOMPATH=$(locate particle_CLASS_h.so)
CUSTOMPATH=$(dirname $CUSTOMPATH)
echo $CUSTOMPATH
PATH=$PATH:$CUSTOMPATH
echo $PATH