GNU Multiple Precision Arithmetic Library 6.1.1 for Visual Studio 2015

A small tip outside my expertise, enjoy.

For building GMP (GNU Multiple Precision Arithmetic Library, http://gmplib.org) under Windows you can follow theses easy step;

– Get latest GMP [1].

– Create a folder to store your GMP’s library (example C:\gmp)

– Get [MinGW][2].

– Do a full install of MinGW. (+-400m)

– Run msys.bat from C:\MinGW\msys\1.0 if you installed in the default directory.

– Run ./configure --prefix=/c/GMP --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 -disable-static --enable-shared. Please note there I didn’t used --enable-cxx as the c++ module does not seem to compile well with the new GMP’s library. (It reference inttypes.h that mingw can’t find)

– Run make

– Run make install

-Run dumpbin /exports libgmp-10.dll >libgmp-10.exports

-Edit the file libgmp-10.exports to leave there only the function name.

-Run lib /def:libgmp-10.def /out:libgmp-10.lib

and voila, you are done.

You will have a .h and a .lib library that you can link to Visual Studio like a .lib.

[1]: http://gmplib.org
[2]: http://sourceforge.net/projects/ming

Advertisement

2 thoughts on “GNU Multiple Precision Arithmetic Library 6.1.1 for Visual Studio 2015

  1. I am a novice in this field, therefore I`m completely lost. it would be nice if you create a video tutorial about how to install the gmp library in windows 64 bits.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s