Macros working in root5 give error in root6

Hi,

Two days back, I upgraded my mac OS from Sierra to HighSierra and I successfully installed ROOT6 today following the recipe here[1]. The xcode version is 9.1. But when I’m trying to run the macros which used to work fine in root5 now gives the error. For example, you can consider the attached macro. While running this it gives me

/Users/niladri/test.cc:17:3: error: use of undeclared identifier ‘DrawExclusion’
DrawExclusion(0.5,0.8,-1.5,5,3008,kBlue,“Ex1”);
^
/Users/niladri/test.cc:20:3: error: use of undeclared identifier ‘DrawExclusion’
DrawExclusion(3.2,3.5,-1.5,5,3008,kGreen,“Ex2”);
^

and I also tried few other macros, the similar type error is also found there. Is it a bug in ROOT6 or is there any workaround for this ? It seems me that I need to change/modify all my old macros to make it work in root6. I would really appreciate if you have any comments/suggestions.

thanks & cheers, Niladri

[1] Load Error: Failed to load Dynamic link library root

test.cc (1.2 KB)

ROOT6 seems to play more by C++ rules than ROOT5. In this case, you need to have declared the DrawExclusion function before you can call it. Either make an external .h-file, or just put the declarations on top of the file, like so

TCutG* DrawExclusion (double Xlow, double Xhigh, double Ylow, double Yhigh, unsigned int fillStyle, unsigned int color,TString name);

Indeed ROOT is fully C++ …

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