About documenting R__LOAD_LIBRARY (i.e. using ROOT-compiled classes in ROOT scripts)

Dear all,

since I migrated to ROOT 6, I started to add at the beginning of my “one-main-function” scripts the following lines to make available to this script the class code that I have compiled with gSystem->CompileMacro:

// As of ROOT 6.04, this is the way to expose the symbols of these
// compiled libraries into a script.
R__LOAD_LIBRARY(PMTtestChannel)
#include "PMTtestChannel.hpp"

It works and I do not need to call gROOT->Load() in some place in the script. However, should I keep these lines if the script, after renaming my-one-main-function() to main(), is compiled to produce an executable?

At the time I thought it was a temporary workaround and I cannot find anymore the source of this information (very likely a forum post). So I am wondering if this is still the correct way to do and if you have a tutorial or any other documentation about this topic. For example it is not mentioned in the User’s Manual chapter “Adding a class” (and I am always afraid that this big manual adapted from ROOT 5 is not representative of the forefront of the ROOT development)

I think that having a how-to/tutorial/official explanation on this topic in a place easy to find would be beneficial

Matteo


ROOT Version: 6.16.00
Platform: Debian 9
Compiler: gcc 6.3


In short, “R__LOAD_LIBRARY” does nothing in a (pre)compiled macro.

See also:

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