Hi Pascal, I cannot reproduce your problem. Could you send me the output of h1->Dump() ? Could you run the following trivial program? Rene Brun //------------------------------------------------------------------- #include "TROOT.h" #include "TH1.h" //#include "TCanvas.h" TROOT rootBase("toto","test root"); int main(int argc,char **argv) { TH1F *h1; h1 = new TH1F("h1","Histogram 1",100,0.,100.); h1->Dump(); } // end of main Pascal Perrodo wrote: > > Hi, > > I try to run ROOT on the ATLAS cluster (hp version 10). > I use: > ROOTSYS = /afs/cern.ch/na49/library.4/ROOT/v2.13/hp700_ux102/root/ > LD_LIBRARY_PATH = > /afs/cern.ch/na49/library.4/ROOT/v2.13/hp700_ux102/root/lib > As an interactive process( $ROOTSYS/bin/root ), ROOT works fine. > > I now try to write a simple c++ code which calls ROOT and tries to create > an histo and dump it. This histo is badly created (xmin=xmax). I don't > understand why. > Please find below the makefile and the simple code a.cxx > Many thanks in advance for your help. > > Pascal Perrodo. > > ------------------------------------------------------- > # > # Makefile for compile of c++ code with call to ROOT libs > # > > C++FLAGS = -g -I$(ROOTSYS)/include > LDFLAGS = -g > > CC = cc > CXX = CC > LINKER = $(CXX) > > ROOTLIBS = -L$(ROOTSYS)/lib -lNew -lBase -lCint -lClib -lCont -lFunc\ > -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMeta -lMinuit -lNet \ > -lPostscript -lProof -lTree -lUnix -lZip > ROOTGLIBS = -lGpad -lGui -lGX11 -lX3d > > LIBS = $(ROOTLIBS) -lm > GLIBS = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/lib/X11R5 \ > -lXpm -lX11 -lm -ldld > > CCNAME = a > > OBJ = $(CCNAME).o > SRC = $(CCNAME).cxx > > all: $(CCNAME) > > $(CCNAME): $(OBJ) $(SRC) > $(LINKER) $(LDFLAGS) -o $(CCNAME) $(OBJ) $(GLIBS) > > $(CCNAME).o: $(SRC) > $(CXX) -c $(CCNAME).cxx $(C++FLAGS) > > ----------------------------------------------------------------------- > //------------------------------------------------------------------- > // > // Example of ROOT libraries called in a C++ code > // > // Pascal Perrodo 25/02/1997 > //------------------------------------------------------------------- > > #include <stdio.h> > #include <stdlib.h> > #include <iostream.h> > #include <math.h> > > #include "TROOT.h" > #include "TH1.h" > > #include "TCanvas.h" > > // needed by Motif > extern void InitGui(); > VoidFuncPtr_t initfuncs[] = { InitGui, 0 }; > TROOT rootBase("toto","test root",initfuncs); > > int main(int argc,char **argv) > { > > TH1F *h1; > > h1 = new TH1F("h1","Histogram 1",100,0.,100.); > h1->Dump(); > > } // end of main > ----------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:41 MET