Hello,
I got a problem with TCanvas.
I write a program with a makefile, I compile it with no issue.
But when i launch it, there are non graphical output.
I use the following makefile :
[code]CXXFLAGS := -g -Wall
CXX = g++
ROOTCFLAGS := $(shell root-config --cflags)
ROOTLIBS := $(shell root-config --libs) -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -lTreePlayer -lMLP -lMinuit -lHtml -lThread
CXXFLAGS += $(ROOTCFLAGS)
LIBS = $(ROOTLIBS) $(SYSLIBS)
SRC = $(wildcard *.cpp)
OBJ = $(SRC:.cpp=.o)
EXE = main
all : $(EXE)
$(EXE):$(OBJ)
$(CXX) ${LIBS} -o $(EXE) $(OBJ)
%.o : %.cpp
@echo "-> Building object : " $@
@$(CXX) $(CXXFLAGS) -fPIC -o $@ -c $<
clean :
@rm -f *.o
@rm -f main[/code]
and the part of my program who don’t work is :
[code]//includes
#include “Drift.h”
using namespace std;
int main(int argc,char** argv)
{
//////Code for filling my class
TH2D *hTraceXZ = new TH2D ("h" , "SRIMXZ", (Int_t)NbStripX,(Double_t) 0.0 ,(Double_t)NbStripX ,(Int_t)NbImages ,(Double_t)0. ,(Double_t)NbImages );
for(int i = 0 ; i < (MyClass->GetTraceXZ()).size() ; i++)
{
for (unsigned int j = 0; j < ((MyClass->GetTraceXZ()).at(i)).size(); j ++)
{
hTraceXZ->Fill((MyClass->GetTraceXZ())[i][j],j);
cout<<"pouf1 "<<(MyClass->GetTraceXZ())[i][j]<<endl;
}
}
TCanvas *c1 = new TCanvas("c1","c1");
cout<<hTraceXZ->GetEntries()<<endl;
hTraceXZ->Draw("");
return 0;
}[/code]
Please help. Thanks