Problems running GMP

remmellabs at remmellabs at
Mon Aug 25 17:15:50 UTC 2014

Dear Sir:

I am using Linux Fedora 20 on a PC.

I installed GMP with the following instructions:

cd Downloads
cp gmp-6.0.0a.tar.bz2 /ron
cd /ron
bunzip2 gmp-6.0.0a.tar.bz2
tar -xvf gmp-6.0.0a.tar
cd gmp-6.0.0
make check

I copied the following files to the place where C++ looks for include files:

cp gmp.h /usr/include/c++/4.8.3
cp gmpxx.h /usr/include/c++/4.8.3

(Why didn't the make command put these files in 4.8.3 automatically?)

cd /ron/book    This is my working directory.

Then I wrote the following program called yy.c++:

#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>

int     main(void)
        {mpz_t x;
        mpz_t y;
        mpz_t result;
        return EXIT_SUCCESS;}

Then I compiled:  g++ -o yy yy.c++

There were four error messages, including:

...undefined reference to '__gmpz_set_str'
...undefined reference to '__gmp_printf'

Please help!

Dr. Ronald S. Remmel
Remmel Labs
Houston, TX USA
The #1 Worst Carb Ever?
Click to Learn #1 Carb that Kills Your Blood Sugar (Don't Eat This!)

More information about the gmp-discuss mailing list