delta trinity
Mon, 14 Apr 2003 13:27:06 -0400

Hi.  I think your question is more on how to compile GMP directly.  The 
straight answer is 'no', you can't just use GMP directly right 'out of the 

You need to download GMP and then, you need to compile it (either as a 
static or shared (dll) library).  You need some tools to first execute the 
configuration script and tell the compile options (what target platforms, 
what build options, ...).  This will move some files across the GMP 
directory and create a suitable gmp.h.

This is because GNU-MP is cross-platforms and intended to be able to compile 
on many different platforms.  And yes, Windows(r) is supported and you also 
have the chance to build it as a 'dll'.

Note that many compilers can't compile the assembler files directly.  One 
good tool for this, that I heard of, is NASM.

So, you'll have to do a lot of reading, testing and tryings...

Alternatively (the 'easy' way), what may be better suited, is if you find 
someone who already compiled the library.  I did manage to compile the 
libraries (GMP 4.1.2) that rely on msvcrt.dll (no cygwin.dll) and have put 
them on my ftp server (  There, I've build the 
'shared' libraries (i.e. DLL) optimized for different x86 platforms.  I also 
have put some associated files (gmp.h, manuals, some readme and legal stuff, 

To compile under VC, I don't know the 'exact' procedures but I suspect it's 
similar to BC++ or MSVC.  You'll need to generate a '.lib' from the dll.  
For that, I'm affraid you're on your own because I don't know the exact 
procedures as I said.  I suspect it's something similar to other compilers, 
by using some of the tools provided with your compiler (ex: with Borland, 
you use IMPLIB.EXE, and for MSVC, you use IMPDEF and LIB) that take a dll 
and output a '.lib'.

Then, you add the .lib to your project and #include <gmp.h> (or "gmp.h") in 
your source code...  After that, there's no need to mess-up with the 
specificities of calls to dll, it's all done in gmp.h.  Just ensure that the 
dll itself (called LIBGMP-3.DLL) is in your program directory.

If you have further questions, don't hesitate to ask.  We all were 'newbies' 
once in our life... :)

aka Delta Trinity.

>From: "Penniboyina, Sankara Rao" <>
>To: "''" <>
>Subject: GMP.h
>Date: Mon, 14 Apr 2003 16:21:22 +0530
>    I am new to GMP. I am going through C code of a encryption method.
>    There gmp.h is included. Where can I get it. Can I use that in TC for

Help STOP SPAM with the new MSN 8 and get 2 months FREE*