Borland C++ Builder MPFR trouble

Sisyphus sisyphus1 at
Tue Nov 1 12:42:21 CET 2005

----- Original Message ----- 
From: "Daniel Bernardo" <info at>
To: <gmp-discuss at>
Sent: Sunday, October 30, 2005 9:36 AM
Subject: Borland C++ Builder MPFR trouble

> I'm trying to compile a win32 executable with Borland C++ Builder using
the GMP dll compiled by Trinity (libgmp-3.dll).
> The dll gets linked fine only if I don't user MPFR references.

I don't think Delta Trinity's libgmp-3.dll incorporates any mpfr
functionality, in which case any references to mpfr functions will be
unresolved. Normally you build your GMP library, then you download the MPFR
source from and build the MPFR library.
The GMP source does come with MPFR, but that version of MPFR is outdated and
buggy, and should be avoided. (I don't know why it's still included.)

> When I compile the same code with GCC/Ming I call gcc in this way:
> gcc -o app_name source.c -lmpfr -lgmp

So you've got a libmpfr.a and libgmp.a. Where did you get them from ? (I'm
having trouble fitting the pieces together .... might be my problem, not
necessarily yours :-)

> And it works fine, I know the -lmpfr -lgmp parameters are telling GCC to
search for the named library in the standard set of libraries, so it
resolves references to mpfr
> functions.
> Now how can BCB 6 linker resolve mpfr functions references, so I can use
mpfr functions?

Same thing, I guess - BCB 6 needs to link to the mpfr and gmp libraries.

Seems to me that you already have MinGW installed, so why not install MSYS
as well ? Then you can build both libgmp-3.dll and libmpfr-1.dll yourself.
You have apparently managed to create the GMP import library from
libgmp-3.dll. Just apply the same process to create the MPFR import library
from libmpfr-1.dll. Then you should have all you need to build MPFR apps
using Borland.


More information about the gmp-discuss mailing list