It seems I almost succeeded:
gSystem->DynFindSymbol(nullptr, "_Z38vtkRenderingOpenGL2_AutoInit_Constructv")
Unfortunately, it requires the mangled name of the function.
How can I get this from ROOT?
I tried:
root [0] gInterpreter->GetMangledName(0, "SomeFunction", "()")
(TString) ""[0]
root [1] gInterpreter->GetMangledNameWithPrototype(0, "SomeFunction", "SomeFunction()")
(TString) ""[0]
root [2] gInterpreter->GetMangledNameWithPrototype(0, "SomeFunction", "void SomeFunction()")
(TString) ""[0]
root [4] gInterpreter->GetMangledNameWithPrototype(0, "SomeFunction", "SomeFunction(void)")
(TString) ""[0]
root [3] gInterpreter->GetMangledNameWithPrototype(0, "SomeFunction", "void SomeFunction(void)")
(TString) ""[0]
It seems that if the Cling itself does not know the function, the “gInterpreter
” will not return its mangled name at all.