Home | News | Documentation | Download

Can't Get Compiled code to run


#1

ROOT Version: 5.34/36
Platform: Not Provided
Compiler: Not Provided


Hi,

I am new to root and I am trying to compile and run my macroCompile_Code.txt (4.9 KB). The code compiles fine when I use (g++ -L Testing BE_cams_AvgPix.C root-config --cflags --glibs) but when I try to run the compiled code using ‘./a.out’ I get the attached errorCompile_Error.txt (2.1 KB).

Any help would be really appreciated!

Kind Regards,

Rex


#2

Hi Rex,

it’s hard to tell. What is the minimal code snippet which reproduces the problem?

Cheers,
Danilo


#3

It looks like the SetBranchAddress lines has a problem because when I run this code: Compile_Code.txt (1.2 KB) without those 4 lines then it seems to compile and run fine. Thing is, the interpreter seems to read it fine.
Kind Regards,

Rex


#4
  TFile *f = TFile::Open("CCD_images_trees.root");
  if ((!f) || f->IsZombie()) { delete f; return 1; }
  TTree *TreeB; f->GetObject("Biases", TreeB);
  if (!TreeB) { delete f; return 2; }
  TH2I *Bias_cam0 = 0, *Bias_cam1 = 0, *Bias_cam2 = 0, *Bias_cam3 = 0;

#5

Hi, sorry, would you mind explaining to me what the difference between what I’ve written and the working version above?


#6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.