question on fixing gmp header file so LiDIA can compile

A

anonymous

I cannot compile LiDIA mathematical library version 2.1pre5 with the gmp 4.1.2
multiprecision library because the gcc compiler ver 3.2.2 20030222 Red Hat
Linux 9 complains about some structures in the gmp.h header file:

/usr/local/include/gmp.h:2073: declaration of C function `std::eek:stream&
operator<<(std::eek:stream&, const __mpq_struct*)' conflicts with
/usr/local/include/gmp.h:2072: previous declaration `std::eek:stream&
operator<<(std::eek:stream&, const __mpz_struct*)' here
/usr/local/include/gmp.h:2074: declaration of C function `std::eek:stream&
operator<<(std::eek:stream&, const __mpf_struct*)' conflicts with
/usr/local/include/gmp.h:2073: previous declaration `std::eek:stream&
operator<<(std::eek:stream&, const __mpq_struct*)' here
/usr/local/include/gmp.h:2076: declaration of C function `std::istream&
operator>>(std::istream&, __mpq_struct*)' conflicts with
/usr/local/include/gmp.h:2075: previous declaration `std::istream&
operator>>(std::istream&, __mpz_struct*)' here
/usr/local/include/gmp.h:2077: declaration of C function `std::istream&
operator>>(std::istream&, __mpf_struct*)' conflicts with
/usr/local/include/gmp.h:2076: previous declaration `std::istream&
operator>>(std::istream&, __mpq_struct*)' here
make[1]: *** [bigmod.o] Error 1

How might one fix this problem? Is the gmp.h file not ANSI compliant? I would
like to get LiDIA up and running.

snipped from the gmp.h header -

/**************** C++ routines ****************/

#ifdef __cplusplus
__GMP_DECLSPEC_XX std::eek:stream& operator<< (std::eek:stream &, mpz_srcptr);
__GMP_DECLSPEC_XX std::eek:stream& operator<< (std::eek:stream &, mpq_srcptr);
__GMP_DECLSPEC_XX std::eek:stream& operator<< (std::eek:stream &, mpf_srcptr);
__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpz_ptr);
__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpq_ptr);
__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpf_ptr);
#endif

what changes need to be made? I am not that familiar with C++ to fix the
problems immediately and would appreciate a more knowledgable person's advice.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top