#include <TApplication.h>
#include <TTree.h>
#include <TFile.h>
#include <TROOT.h>
#include <TUnixSystem.h>

extern void InitGui();
VoidFuncPtr_t initfuncs[] = {InitGui, 0};

TROOT root("Rint","The ROOT Interactive Interface", initfuncs);

class TViewer {

 private:
  TTree *fTree;
  TFile *fFile;

 public:
  TViewer() {
    TUnixSystem System;
    // Code fails with the above line -- comment out or
    // replace with 
    // TUnixSystem *System = new TUnixSystem();
    fFile = new TFile("tree3.root");
    fTree = (TTree *)fFile->Get("t3");
    fTree->StartViewer();
  }
  ~TViewer() {delete fTree; delete fFile;}

};

void main(int argc, char **argv) {
 
  TApplication theApp("test",&argc,argv);
  new TViewer();
  theApp.Run();

}

  
