Strictly native win32 version?

delta trinity
Thu, 10 Apr 2003 12:00:21 -0400

>Is there somewhere a binary, or an howto, of a libgmp.dll compiled with, 
>and usable with, MS VisualC++-Net (v7)? Sorry if this is a FAQ, I have read 
>the whole web site, or tried to, and not found a definitive asnwer.
>Michel Bardiaux
>Peaktime Belgium S.A.  Bd. du Souverain, 191  B-1160 Bruxelles
>Tel : +32 2 790.29.41


Hi.  It took me a real while to figure out how to do it but I did compile it 
some time ago GMP 4.1.2 for native Windows DLL (Using MSVCRT, no CYGWIN).  
You can look at GMP archive for threads posted by me (my nick, Delta 
Trinity) to see how to compile it.

Alternatively, I've put it on my home ftp server at

There, you'll fine the dll optimized for all the different processors, for 
Windows, along with gmp.h and some other related files.

If I remember well, for use in MSVC, you need to generate a .lib from the 
DLL.  To do that, you use some tools provided with MSVC (should be installed 
in your MSVC binary directory).

IMPDEF libgmp-3.def libgmp-3.dll
LIB /def:libgmp-3.def /out:libgmp-3.lib

Then, you just #include "gmp.h"  and tell your compiler to link with 
libgmp-3.lib.  I don't remember the exact way you need to do to include it 
but it should be in the options somewhere.  Alternatively, you can type 
#pragma comment(lib,"libgmp-3.lib") in your source code but that's probably 
not the preffered way (??).

Tell me if you find any problems...


(aka Delta Trinity).

Add photos to your messages with MSN 8. Get 2 months FREE*.