Class TVirtualX * gVritalX unresoved reference using make

class TVirtualX * gVritalX unresoved reference using make

Dear Routers,

I have installed root_v3.10.02.win32gdk.tar on WinXP. I use
C++7.net.

The global variable gVirtualX is not defined when I try to build my
program.

I could reproduce the error by using guitest.C:

Starting cygwin and root, then “.x guitest.C”
(from directory tutorial) everything looks fine.
Compiling guitest (with #define STANDALONE) using make the linker could not
find gVirtualX.

Where is gVirtualX defined? Do I have to define it myself?
Using gVirtualX in my program I get illegal redefinition because gVirtualX
it is in a #define statement in TVirtualX.

Dieter Notz
DESY

Hi Dieter,

Did you install ROOT under CYGWIN ?
Can you run the basic ROOT tutorials ?

gVirtualX is defined in TVirtualX.h
#define gVirtualX (TVirtualX::Instance())

Rene

Hi Dieter,
one of the ways to create standalone executable
based on guitest.C under windows is the following:

  1. create guitest_C.lib/guitest_C.dll

    root[].L guitest.C++

  2. cut and paste STANDALONE part from guitest.C
    into the new file guitest.cxx

#include <TApplication.h>
#include <TROOT.h>
extern void guitest();

int main(int argc, char **argv)
{
TApplication theApp(“App”, &argc, argv);
guitest();
theApp.Run();
return 0;
}

  1. compile this program adding guitest_C.lib to the list of libraries.
    VC7 project file is in attachment

Regards. Valeriy
guitest.zip (129 KB)