bug-gmp
[Top][All Lists]
Advanced

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

Re: GMP and DJGPP


From: Richard Dawe
Subject: Re: GMP and DJGPP
Date: Tue, 19 Mar 2002 23:14:13 +0000

Hello.

Chris Johnstone wrote:
[snip]
> I'm using the DJGPP build of GMP 4.01.
> 
> I'm trying to get this program to compile with gpp:
> 
> compile line: gcc -o main.exe test.c -lgmp
[snip]
c:/djgpp/tmp\ccMJ9X6m.o(.gnu.linkonce.t._ZlsI16__gmp_unary_exprI10__gmp_exprI12__gmpz_valueS2_E18__gmp_abs_functionEERSoS6_RKS1_IS2_T_E+0x30):test.c:
> undefined reference to `operator<<(std::ostream&,
> __mpz_struct const*)'
> c:/djgpp/tmp\ccMJ9X6m.o(.gnu.linkonce.t._ZlsRSoRK10__gmp_exprI12__gmpz_valueS1_E+0x1c):test.c:
> undefined reference to `operator<<(std::ostream&,
> __mpz_struct const*)'
> 
> Does the C++ half of GMP not work for DJGPP, or am I
> missing something obvious?

I think you need to compile with g++. Also you should probably link in the GMP
C++ library with -lgmpxx. Try something like:

    gpp -o main.exe test.c -lgmp -lgmpxx

Please note that the C++ code in the DJGPP package was compiled with g++
3.0.3. If you are using g++ < 3, then you will have to rebuild GMP yourself,
to get a GMP C++ library compatible with your compiler. (The C++ ABI changed
between g++ 2.x and 3.x.)

Hope that helps, bye,

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]



reply via email to

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