newt.cpp and limits not compiling


JoelMiller
05-17-2002, 04:10 PM
I am running red hat v7.2. I am trying to compile a program using newt.cpp. Unfortunately for the line
#include <limits>
I get the error message:

newt.cpp:2:18: limits: No such file or directory

and it's right; the file `limits' does not exist. There is a `climits', which simply calls `limits.h'. I've tried either limits.h or climits in the include statement. For the line
const DP TOLX=numeric_limits<DP>::epsilon();
I get a new error message:

newt.cpp:13: `numeric_limits' undeclared

Can anyone tell me if there is a clean way to fix it, or if I should simply hardcode in a value for TOLX? If I need to hard code it, roughly what should I make it?

Saul Teukolsky
05-18-2002, 12:29 PM
Take a look at the posting "C++ and GNU 2.9X compiler" (http://www.nr.com/forum/showthread.php?s=&threadid=31) in this section. I believe RH 7.2 has rpms with the 3.0 compiler.