Please read tips for efficient and successful posting and posting code
ROOT Version: 6.16
Platform: linux8664gcc
Hello,
I’ve been having an error when trying to use a void function inside a macro “testing.c”.
Here is the code I have been trying to use (t_halo is an already created histogram within the root file “test.root”):
void testing(){
TFile *f = new TFile("test.root","UPDATE");
t_halo->Draw();
}
I get the following error when running this macro:
However, this code works if I type the following text into the command line before running the macro: TFile *f = new TFile("test.root","UPDATE");
This code also works if I remove void test(). I’ve included this below:
{
TFile *f = new TFile("test.root","UPDATE");
t_halo->Draw();
}
I’m trying to use functions in a bigger macro and am having the same problem, so if anyone knows why this isn’t working I would greatly appreciate a response.
Thanks in advance.