MPFR basics

Sisyphus kalinabears at iinet.net.au
Mon Dec 15 05:05:25 CET 2003


Hi,
The following builds and runs fine so long as I link to both -lmpfr and 
-lgmp (in that order):

-----------------------
#include <stdio.h>
#include <gmp.h>
#include <mpfr.h>

int main() {
      mpfr_t x;
      mpfr_init (x);
/*   mpfr_set_str(x, "123456.2", 10, GMP_RNDN); */
      mpfr_clear(x);
      printf("Done\n");
      return 0;
}
-----------------------

But as soon as I include the mpfr_set_str() call I get (multiple) 
undefined references to __gmpn_copyd and __gmpn_copyi.
What have I done wrong ? I built gmp-4.1.2 and mpfr (in an MSYS shell on 
Windows2000 using gcc) with:
./configure --disable-static --enable-shared --enable-mpfr

Cheers,
Rob

-- 
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.



More information about the gmp-discuss mailing list