Hi,
I’m trying to do a relatively simple thing. I want to expose a class of mine through a shared library so that i can use it both in CINT and (eventually) pyROOT. Note that for now this is compiled against ROOT 5.34.34 on an Ubuntu box.
The compilation of my code succeeds and I can even load the shared library using gSystem->Load(“libAnalysis”) but then during the instantiation of my class MyClass(), I get an error about a TFile method which is undefined in the shared lib.
The Makefile includes making the dictionary based on include/LinkDef.h and the logs folder contains the output from both the Makefile and later from the CINT invocation. My suspicion is that the LinkDef.h contains too strong linker directives but I can’t figure out how top fix this.
Hi Danilo,
This is certainly a possibility of wanted to investigate now, but it would be great if someone could provide a pointer on how to do this… ROOT changed quite a bit on this aspect. Just as a reminder though: this should be doable using native clang/gcc and not from the CINT /cling compiler.
Thanks Axel,
I haven’t followed up on this because in the end I solved it compiling using CINT and then importing it in python using the usual “from ROOT import Analysis” or something like that. Interestingly enough, after changing the order in the Makefile, as you suggested, I now only get a mild warning:
root [0] gSystem->Load("lib/libAnalysis")
Warning in <TClassTable::Add>: class TFile already in TClassTable