Hi, sorry, protection was missing (is in place now). For time being do: int main(int argc, char **argv) { ... TApplication theApp("App", &argc, argv); Notice passing or args. Cheers, Fons. Jayoung Wu wrote: > > On Wed, 4 Mar 1998, Fons Rademakers wrote: > > > > Now to make your program in point 3) work as expected, add the lines: > > > > int main() > > { > > TROOT ytrack("plot2","plot test"); > > > > // Create application environment, needed for interactive apps. > > // Alternatively can create a TRint object, I which case you > > // get also command line input capability. > > TApplication theApp("App", 0, 0); > > > > TCanvas *c1 = new TCanvas("c1","Tracking of Incident Particle", > > 200,10,700,500); > > c1->Update(); > > > > theApp.Run(); // will not return > > > > return 0; > > } > > > > > > For more detail see $ROOTSYS/test/hworld.cxx. > > > > Cheers, Fons. > > > > For point 3) I tried according to your suggestion but I got the error > message: > *** Break *** segmentation violation > IOT trap > > ======================= My code was > #include <stdio.h> > #include <math.h> > > #include "TROOT.h" > #include "TFile.h" > #include "TTree.h" > #include "TBranch.h" > #include "TObject.h" > #include "TH1.h" > #include "TCanvas.h" > #include "TApplication.h" > > Int_t main() > { > TROOT ytrack("plot2","plot test"); > TApplication theApp("App", 0, 0); > > TCanvas *c1 = new TCanvas("c1","Tracking of Incident Particle", > 200,10,700,500); > > // c1->Modified(); > c1->Update(); > > theApp.Run(); > return 0; > > } > > --- > Thanks a lot! > Jayoung -- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland Phone: +41 22 7679248 E-Mail: Fons.Rademakers@cern.ch Fax: +41 22 7677910
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:30 MET