Problems running GMP

remmellabs at juno.com remmellabs at juno.com
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
./configure
make
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;
        mpz_set_str(x,"12345678901234567890",10);
        mpz_set_str(y,"12345678901234567890",10);
        mpz_mul(result,x,y);
        gmp_printf("%Zd\n",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!)
http://thirdpartyoffers.juno.com/TGL3131/53fb6f6660da36f6648a1st04duc


More information about the gmp-discuss mailing list