C++ Macro in ROOT Does Not Terminate Properly

[quote=“Pepe Le Pew”]1. Try to precompile your macro using ACLiC, in order to find source code problems, e.g. try something like (inspect all reported warnings and errors):
root [0] .x Function.C++

  1. You can “debug” many problems using “valgrind”. See, for example: Segmentation Fault depending on linux distribution

BTW. Instead of “openFile->Close();”, you should have “delete openFile;”[/quote]

  1. I tried .x Function.C++, and all I get are error messages because C++ does not understand types like TFile, TMath, TTree, etc. There is no error otherwise.

  2. I used delete openFile; instead. The program still does not terminate; the print statements right before and after are both printed properly.