Skip to main content

Thread: GMP installed,compilation problem


i have installed gmp 5.0.0....

when im trying compile code getting these errors!!!
code follows:
#include <stdio.h>
#include <gmp.h>

int main (void)
{
mpz_t r, n;
mpz_init (r);
mpz_init_set_str (n, "123456", 0);
gmp_printf ("%zd\n", r);
return 0;
}
errors:
bvjkishore@ubuntu:~/c$ g++ k.cc -lgmp
/lib/../lib/libgmp.so: undefined reference `__gmpn_mul_1c'
/lib/../lib/libgmp.so: undefined reference `__gmpn_rsh1add_n'
/lib/../lib/libgmp.so: undefined reference `__gmpn_sub_nc'
/lib/../lib/libgmp.so: undefined reference `__gmpn_modexact_1_odd'
/lib/../lib/libgmp.so: undefined reference `__gmpn_add_nc'
/lib/../lib/libgmp.so: undefined reference `__gmpn_addlsh1_n'
collect2: ld returned 1 exit status..

have compiled "g++ test.cc -o test -lgmp"

, installation of gmp-5.0.0 done in asusal way ..like
downloaded"gmp-5.0.0." gmplib.org/

, unzip..with tar command

./configure
sudo make all


please me out of these problems!! ;(

how compiling program? have link gmp library during compilation. example, if file test.c, do:

code:
gcc -wall test.c -o test -lgmp


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] GMP installed,compilation problem


Ubuntu

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts