C++ exception caught

Hi ROOTers,

I’m running ROOT 5.18 on WinXP. For some reason, this short macro:

int tdcFit2()
    TFile* file = new TFile("dummy.root","RECREATE");
    TH1F h_bla("hist","hist_title",10,0,10);
    return 0;

produced this:

root [4] .x tdcFit2.C
Error: C++ exception caught D:\tdcFit2.C(10)

This causes some problems with a much bigger macro I’ve written. Any idea why this happens?


Hi Nir,
see root.cern.ch/phpBB2/viewtopic.php?t=4068
Just create the histogram on the heap using new.
Cheers, Axel.