[ROOT] Core dumped executing a program with ROOT libs

From: Emilio Jose Vilchez Martinez (evilma@obelix.umh.es)
Date: Mon Jul 16 2001 - 20:26:13 MEST


Hello , 

I am a new Spanish user of root and is the first time I program in C++,
I have done a simple example from root user guide (a canvas that is
divided in four pads) and i add one graph in each one, but while in root
interpreter it works fine, when I try to compile the program with gcc-2.95
in a linux Mandrake 7.2 including the shared librarys provided with ROOT
it links without any problem but when I execute the program  a core dumped
message is returned.

This the C++ code(prueba.C):
 
#include "TCanvas.h"
#include "TGraph.h"
#include "TF1.h"


void main(){


    TF1 f1("fun1","sin(x)/x",0,10); 
    TF1 f2("fun2","sin(x)/x",-5,5);
    TF1 f3("fun3","x^2",0,10);
    TF1 f4("fun4","x^2",-5,5);
    TCanvas * MyC =new TCanvas("MyC","Test Canvas",1);
    MyC->Divide(2,2);
     MyC->cd(1);
    f1.Draw("AC*");
     MyC->cd(2);
    f2.Draw("AC*");
     MyC->cd(3);
    f3.Draw("AC*");
     MyC->cd(4);
    f4.Draw("AC*");
    

}    
   
this is the makefile:



CC = g++
LIB=-lCint -lCore -lEG -lGX11 -lGX11TTF -lGpad -lGraf -lGraf3d -lGui -lHist -lHistPainter -lHtml -lMatrix -lMinuit  -lNew -lPhysics -lPostscript -lProof -lRGL -lRint -lThread -lTree -lTreePlayer -lTreeViewer  -lX3d 

EXEC = prueba
I = /home/emilio/root/include

$(EXEC) : prueba.o
	$(CC) -I$(I) $(LIB) -o $(EXEC) prueba.o
prueba.o : prueba.C  
	$(CC)  -I$(I) -c prueba.C  


Is obvious that I am a new C++ user on unix seing the code of the makefile
i have always programmed on windows platform with visual or borland C++
but one day I thought why not unix, why not free...

The last question, is possible to run root on Mandrake 8.0 and there are
some advantages respect 7.2 version.

Thanks 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:52 MET