I'm seeing a little erratic GetInterfaceMethod behaviour between my
compiled program and running in root direct, and I don't know how to
track it down. Perhaps there is some interpreter initialisation I need
to do first? I've attached a test script that writes out a basic .C
macro, then attempts to load it and read the address of a function out
of it with the prescription:
gROOT->LoadMacro(filename);
TInterpreter* interp = gROOT->GetInterpreter();
void* func = interp->GetInterfaceMethod(0,funcname,"");
return (bool)func;
Running through root gives:
$ root ReadC.C
Result of search: 1
Running through ACLIC gives:
$ root ReadC.C+
Result of search: 1
But compiling as a stand-alone program gives a different answer:
$ g++ -o ReadC ReadC.C `root-config --cflags --libs`
$ ./ReadC
Failed to load function
Result of search: 0
Unfortunately, getting this to work is a necessity, as a pretty ingrained part of our codebase relies on this behaviour (most people run through rootscripts). Does anyone know what is causing this? I tested on 5.27/02 and 5.28/00 and both exhibited this behaviour.
Thanks,
Nick
This archive was generated by hypermail 2.2.0 : Mon Mar 28 2011 - 17:50:02 CEST