0

In my code I'm getting a fatal error of :

fatal error: gmpxx.h: No such file or directory|

I'm trying to use the The GNU Multiple Precision Arithmetic Library, but I'm having trouble trying to get the library downloaded an working in the right place.

I download the file gmp=6.1.0.tar.lz but I have no idea how to open it, use it, or even where it needs to be placed.

I'm using Codeblocks, and a Windows 10 computer.

Olivier De Meulder
  • 2,493
  • 3
  • 25
  • 30
Joe
  • 13
  • 4

1 Answers1

0

First, install some basic GNU utilities via MinGW. We need tar. Then, download a stable lzip release. Choose tarball not lzip archive, because we want to build lzip. Now, open your MSYS shell, go to directory made after extracting lzip tarball (this directory should be available as /c/<PATH ON C DRIVE WITH BACKSLASHES REPLACED WITH SLASHES>) and run:

./configure --prefix=/
make
make install

Then go up (cd ..) and run:

tar xvf gmp-6.1.0.tar.lz

It should extract this file. Now, build GMP by going to directory gmp-6.1.0 and running:

PATH="/c/Program Files/CodeBlocks/MinGW:$PATH" ./configure --prefix='/c/Program Files/CodeBlocks/MinGW'

on 32-bit system, or:

PATH="/c/Program Files (x86)/CodeBlocks/MinGW:$PATH" ./configure --prefix='/c/Program Files (x86)/CodeBlocks/MinGW' --enable-cxx

on 64-bit. Run these commands:

make
make install

You should have GMP installed.

Top Sekret
  • 748
  • 5
  • 21
  • I did the ./configure --prefix=/ and it worked, however when I did , make , I get this: cc -W -02 -c -o carg_parser.o carg_parser.c make: cc: Command not found make: *** [carg_parser.o] Error 127 – Joe Mar 09 '16 at 16:41
  • Wait, what should I be putting something after the --prefix=/ – Joe Mar 09 '16 at 16:44
  • Never mind! Got it! Thanks you so much for you help! – Joe Mar 09 '16 at 22:11