It is here!! Compiled versions of GMP 4.1.3 DLLs for x86 platforms!

delta trinity deltatrinity at
Tue May 11 02:08:36 CEST 2004

Well, I'm kind of late by a few days, I didn't notice that a new version was 
out :-)

To compile GMP, as a DLL, for Windows (x86 platforms), here's what you could 
do, which is pretty simple

Download and install MinGW and MSYS (
Download GMP :-D
De-compress GMP inso the msys directory, under home/username
Start msys
Then, go to GMP de-compressed directory (within MSYS shell) and type:

./configure --disable-static --enable-shared -host=i386-pc-mingw32
(substiture i386 for a processor of your choice, choice listed in the GMP 


This give a DLL which rely on MSVCRT.DLL (instead of CYGWIN).

Borland users:  If you use Borland to use the DLL.  Since it relate on 
MSVCRT (Microsoft), you can't use the file-relater functions like fprintf, 
mpz_out_str, ...  MS FILE struct is different than Borland FILE struct.  But 
it's easily workedaround by using input/output to memory buffers, and doing 
the IO using Borland files


size_t borland_mpz_out_str(FILE *File, int Base, mpz_srcptr Var)
   char* StrBuffer;
   size_t Length;

   if ((StrBuffer=malloc(mpz_sizeinbase(Var,Base)+2))==NULL)
      fprintf(stderr, "borland_mpz_out_str: Memory allocation error!\n");
   return Length;

To keep the tradition, I decided to compile GMP shared library (DLL) for 
those who do not wish to mess with compiling GMP (which actually is pretty 
simple to do, but for people like novice users or people who wish to have a 
readily available DLL, this give one step less to do), I compiled, optimized 
for different x86 platforms.

Note that by 'optimized' mean that any build is usually upward compatible 
(ex: a i386 build would run on an athlon, but may not be as efficient).

The files are online, at my usual server:

Note that I'm in no way related to the GMP project.  I'm not the author.  If 
you wish to thank someone for this great library, say so to the authors!  If 
you wish to thank someone for simplifying the first steps of using GMP, then 
cheer me :)

Thanks to the author!

deltatrinity at

Express yourself with the new version of MSN Messenger! Download today - 
it's FREE!

More information about the gmp-discuss mailing list