I need to include some libraries, that are in a certain path, before running my ROOT macro.
When I ran my code line by line in the ROOT interpreter, starting with:
root  .L full-path-to-my-lib/lib1.so root  .L full-path-to-my-lib/lib2.so root  RecEvent* theRecEvent = new RecEvent(); //RecEvent is defined in one of the libraries. //...Rest of the code...
then everything worked fine.
Then I dumped the code in a .C file. I replaced the lines where I include the libraries with:
R__ADD_LIBRARY_PATH(full-path-to-my-lib) R__LOAD_LIBRARY(lib1.so) R__LOAD_LIBRARY(lib2.so) RecEvent* theRecEvent = new RecEvent(); //RecEvent is defined in one of the libraries. //...Rest of the code...
and tried to run it, but the interpreter showed the following type of errors:
Error: Symbol RecEvent is not defined in current scope myCode.C:10:
I also tried variants including the full-path directly in the R__LOAD_LIBRARY or repeating the R__ADD_LIBRARY_PATH line before the addition of the second library and still failed.
I also want to avoid modifying the .rootlogon.C as I have two versions of ROOT installed, a v.5 and a v.6. I only need to include these libraries for the v.5 and I toggle between versions often.
Could you help me solve this and understand what is going on?
Thank you in advance,
_ROOT Version: 5.34/38
_Platform: Ubuntu 18.04.2 LTS (bionic)
_Compiler: ROOT CINT