[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug Report
From: |
Jim Leary |
Subject: |
Bug Report |
Date: |
Wed, 02 Jan 2002 10:17:16 -0800 |
To: address@hidden
From: Jim Leary address@hidden
Subject: A Possible Bug (C++ Wrapper for Integers)
On 1/1/02, I downloaded 4.0.tar.gz(USA EAST). I am especially
interested in multiple precision integers in C++. The installation
apparently went fine. When I ran
info -f /gmp.info
the first sample program was that listed below. This program was
found in the menu path * C++ Class Interface and
* C++ Interface General. When I attempted to
compile that program, I got the compiler errors listed below the
source code.
I looked inside gmpxx.h and noticed that the declaration of
strstream is commented out at line 39. By putting back this
declaration with
#include <strstream>
the first compiler error
"gmpxx.h:2788: undeclared variable `ostrstream' (first use here)"
goes away. However, other problems come up.
What, if any, fix is needed to at least compile the first
sample program in the documentation.
If a program is as simple as
//-----------------------------
#include "gmpxx.h"
int main (void) { return 0; }
//-----------------------------
you still get exactly the same compiler errors.
The specs about my compiler and system are listed below:
Thank you --- Jim Leary
//=========================================================================//
Sample from gmp.info
//=========================================================================//
#include "gmpxx.h"
#include <iostream>
int
main (void)
{
mpz_class a, b, c;
a = 1234;
b = "-5678";
c = a+b;
cout << "sum is " << c << "\n";
cout << "absolute value is " << abs(c) << "\n";
return 0;
}
//=========================================================================//
Compiler errors
//=========================================================================//
bash$ g++ test_cpp_and_GMP.cpp
gmpxx.h: In method `class string
__gmp_expr<__gmpf_value,__gmpf_value>::get_str2(int = 10) const':
In file included from test_cpp_and_GMP.cpp:1:
gmpxx.h:2788: undeclared variable `ostrstream' (first use here)
gmpxx.h:2788: parse error before `;'
gmpxx.h:2793: `o' undeclared (first use this function)
gmpxx.h:2793: (Each undeclared identifier is reported only once
gmpxx.h:2793: for each function it appears in.)
gmpxx.h:2795: confused by earlier errors, bailing out
//=========================================================================//
Compiler and system specs
//=========================================================================//
bash$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
//=========================================================================//
bash$ uname -a
Linux c29999-b 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown
bash$
//=========================================================================//
bash$ ./config.guess
pentium3-pc-linux-gnu
//=========================================================================//
bash$ ./configfsf.guess
i686-pc-linux-gnu
bash$
//=========================================================================//