bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A bug in the gmp c++ class interface???


From: Deniz Deveci
Subject: A bug in the gmp c++ class interface???
Date: Sat, 05 Jan 2002 16:17:00 +0100

Hello.

I installed today the new version of gmp (gmp-4.0) under Linux without
complications.
I'm interested to use it in combination with the c++ class interface. 
There is a compilation error, if I compile the following testprogram. If
I don't use the c++ class interface everything works.I'm not sure but
it seems to be a error in the gmpxx.h library, in line 2788 the
ostrstream means maybe ostream.

<------------------------- snip ------------------------->
#include <iostream>
#include <gmpxx.h>

using namespace std;

int main()
{

  mpz_class a, b, c;

  a = 545;
  b = "111";
  c = 1;
  
  cout <<"a="<<a<<endl;
  cout <<"b="<<b<<endl;
  cout <<"c="<<c<<endl;

}
<------------------------- snap ------------------------->

I got the following output:

<------------------------- snip ------------------------->
g++ -g -Wall -I/homes4/info-f/ted/lib/gmp-4.0/include
-L/homes4/info-f/ted/lib/gmp-4.0/lib  -o test_gmp-4.0.bin
test_gmp-4.0.cc -lgmp -lgmpxx
In file included from test_gmp-4.0.cc:18:
/homes4/info-f/ted/lib/gmp-4.0/include/gmpxx.h: In method `class string
__gmp_expr<__gmpf_value,__gmpf_value>::get_str2(int = 10) const':
/homes4/info-f/ted/lib/gmp-4.0/include/gmpxx.h:2788: `::ostrstream'
undeclared (first use here)
/homes4/info-f/ted/lib/gmp-4.0/include/gmpxx.h:2788: parse error before
`;'
/homes4/info-f/ted/lib/gmp-4.0/include/gmpxx.h:2793: `o' undeclared
(first use this function)
/homes4/info-f/ted/lib/gmp-4.0/include/gmpxx.h:2793: (Each undeclared
identifier is reported only once
/homes4/info-f/ted/lib/gmp-4.0/include/gmpxx.h:2793: for each function
it appears in.)
/homes4/info-f/ted/lib/gmp-4.0/include/gmpxx.h:2803: warning: control
reaches end of non-void function
`__gmp_expr<__gmpf_value,__gmpf_value>::get_str2(int) const'
make: *** [test_gmp-4.0.bin] Fehler 1
<------------------------- snap ------------------------->


My installing step for gmp-4.0 was the following:
1. tar zxvf gmp-4.0.tar.gz; cd gmp-4.0
2. ./configure --prefix=/homes4/info-f/ted/lib/gmp-4.0 --enable-cxx
3. make
4. make check
5. make install

I use the g++ compiler with version: g++ -v
Reading specs from /opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs
gcc version 2.95.3 20010315 (release)


I hope this is enough information to fix the bug. If there are more
questions please write an email. 

Best regards,
Deniz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]