Problem with TMath functions in compiled program


I am compiling an older code I had running fine until version 5.10, now with 5.18.
All I am doing is: include “TMath.h” (I am not actually yet calling any functions).
But when I compile the program I get a series of weird error messages such as
the one shown below.

Has anyone encountered this problem? Your advice is appreciated !


Michael Gericke

/usr/local/root/include/TMath.h:36: error: expected unqualified-id before numeric constant
/usr/local/root/include/TMath.h: In function ‘Double_t TMath::TwoPi()’:
/usr/local/root/include/TMath.h:37: error: ‘3.14159265359000006156975359772332012653350830078e+0’ cannot be used as a function

… etc.


The code (or one of the include) before TMath.h is defining a cpp macro named Pi which conflicts with TMath method named ‘TMath::Pi’.

Either rename this macro or #undef it before include TMath.h