Problem with GMP 4.1.4 ... cant't link mpz_init2 and mpz_realloc2

Torbjorn Granlund tege at swox.com
Fri Oct 14 18:31:11 CEST 2005


Paulo Sousa <pjsousa at di.fc.ul.pt> writes:

  I installed GMP version 4.1.4 on a Red Hat Linux 7.1 machine with
  kernel 2.4.18 and with gcc version 2.96.
  Everything works fine with the exception that functions mpz_init2
  and mpz_realloc2 seem to have some problem. For instance, when I
  try to use mpz_init2, the linker stops with the following error:
  
  /tmp/cc3iyNzE.o: In function `main':
  /tmp/cc3iyNzE.o(.text+0x13): undefined reference to `__gmpz_init2'
  collect2: ld returned 1 exit status
  
  I'm using the following command to compile/link:
  gcc -o init2_problem init2_problem.c -Wall -lgmp
  
  The test program goes in attachment. The same program works fine
  when using mpz_init.
  
  Any suggestions?
  
Perhaps you have an old libgmp somewhere on the system?
mpz_init2 was added for gmp 4.0.

Can you link to to any gmp functions, e.e., plain mpz_init?

-- 
Torbjörn


More information about the gmp-bugs mailing list