How to...

Manuel Sanchez Garcia (manuel@fpddv1.usc.es)
Fri, 27 Feb 1998 13:59:29 +0100


Hello All

My question is the following; How could i share one variable betwen
the compiled code and the interpreter?. Just in the same way gROOT or
gSystem are accesible from both compiled code and the interpreter.

At the moment I've tried to do it with the following code

Hades::Hades(void) {
Hades **p;
TGlobal *gl;

gHades=this;

gROOT->Reset();
gROOT->ProcessLine("Hades *gHades;");
gROOT->ProcessLine("#include \"HadDef.h\"");
gl=gROOT->GetGlobal("gHades",kTRUE);
p=(Hades **)gl->GetAddress();
*p=gHades;*/

}

that works if i create an objecto of the class Hades within the
interpreter; but i get a segmentation violation if i try to do it in
compiled code.

Thanks, Manuel
------------------------------------------------
Hades
GSI