How to Install and Run GMP on Windows Using MPIR

To perform arbitrary-precision arithmetic in C and C++ programs on Windows, I use GMP. In particular, I use MPIR, a Windows port of GMP. MPIR is a simple alternative to using GMP under Cygwin or MinGW.

I will show you how to install MPIR in Microsoft Visual C++ as a static, 32-bit library. I will also show you how to install the optional C++ interface — also as a static, 32-bit library. I will provide two example C programs that call the GMP integer and floating-point functions, and two equivalent C++ programs — programs that use the same GMP functions, only indirectly through the C++ interface.

Continue reading “How to Install and Run GMP on Windows Using MPIR”