error on mpz_inits and mpz_clears

Niels Möller nisse at
Tue Sep 24 11:48:23 UTC 2019

Rabindra Moirangthem <m.rabin07 at> writes:

> I have installed the gmp library on a centos system. When I compiled my c
> file, it gives errors only when I am using mpz_inits and mpz_clears in my
> program. Other functions compiled successfully.
> The errors given are:
> undefined reference to `__gmpz_inits'
> undefined reference to `__gmpz_clears'
> What seems to be the problem here?

Most likely, you are linking with a too old version of the gmp library.
Do you get this error at compile/link time, or at runtime/loadtime? In
the latter case, try running ldd on your executable, and will tell you
which libraries it loads.


Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.

More information about the gmp-bugs mailing list