Re: error: ‘mpz_inits’ was not declared in this scope

David Gillies daggillies at gmail.com
Mon Sep 19 19:00:10 CEST 2011


I didn't even know there was an mpz_inits function. Maybe I should
read the latest manual. Or maybe you should.

On Mon, Sep 19, 2011 at 9:58 AM, Creatxr <creatxr at gmail.com> wrote:
> Hi,
> It's my first time to use GMP library.
> What's happened with this code?
> thanks.
> =============================================
> /main.cpp|11|error: ‘mpz_inits’ was not declared in this scope|
> /main.cpp|13|error: ‘mpz_clears’ was not declared in this scope|
> =============================================
> #include <iostream>
> #include <gmp.h>
>
> using namespace std;
>
> void mpz_inverseMod(mpz_t r, mpz_t n, mpz_t m) {
>    mpz_t x1, x2, x3;
>    mpz_t y1, y2, y3;
>
>    mpz_init(x1);
> //-------------------------------------above is correct
>    mpz_inits(x1, x2, x3, y1, y2, y3);
>
>    mpz_clears(x1, x2, x3, y1, y2, y3);
> }
>
> int main()
> {
>    cout << "Hello world!" << endl;
>    return 0;
> }
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-discuss
>



-- 
David Gillies
San Jose
Costa Rica


More information about the gmp-discuss mailing list