When I compile an application, I found the below error.
Geant4/PTL/Types.hh:196:84: error: macro “max” requires 2 arguments, but only 1 given
int64_t CountedObject::fmax_depth = std::numeric_limits<int64_t>::max();
Thank you!
FG
When I compile an application, I found the below error.
Geant4/PTL/Types.hh:196:84: error: macro “max” requires 2 arguments, but only 1 given
int64_t CountedObject::fmax_depth = std::numeric_limits<int64_t>::max();
Thank you!
FG
After changing below line from
int64_t CountedObject::fmax_depth = std::numeric_limits<int64_t>::max();
to
int64_t CountedObject::fmax_depth = (std::numeric_limits<int64_t>::max)();
the error disappeared.
Which platform is this on? It’s probable that the translation unit being compiled has a redefinition of max
as a macro somewhere in it or the headers it #include
s.
Thank you, Ben.
I use Ubuntu.
I agree with you. Only when I use the IAEA phase space reader, this error appears. I guess max is defined as a macro somewhere in IAEA phase space reader.
Anyway, after adding () can prevent it from being seen as a macro.