The question has probably already been asked, but I really couldn’t find any satisfactory answer so here I go.
I have some C file, category.c, which defines a certain number of functions (among which CategorySimple(int)) that I would like to access from python. What I found suggested to use :
import ROOT
ROOT.gROOT.LoadMacro(“Category.cc+”)
This step works, but I do not understand how I can access categorySimple after that as it does not become an attribute of ROOT / gROOT nor a function in my program’s namespace.
What is the exact effect of LoadMacro?
Thank you in advance !
That is quite surprising, when I do this I inevitably get an “attribute error” at the last step…
The functions in the c file are defined through :
extern “C” int categorySimple(int n){…}
Could this somehow interfere with what I am trying to do?
(the LoadMacro yields 0 though)
Ok I tried a minimal exemple with just a Hello world function in a file, and clearly LoadMacro works.
Somehow however it does not seem to like the functions from Category.C