Thanks Bill, that works. Under Project > *projectname* Properties > 
Additional Dependencies, I put "...\mpir-2.7.2\lib\Win32\Release\mpir.lib".
The program crashes when I'm trying to call mpz_add(), so I built debug 
library and debugged my program - debugging starts in function 
__gmp_default_reallocate(), file memory.c, at this line
      ret = realloc (oldptr, new_size);
Any ideas please? The program code is:

#include <stdio.h>
#include "mpir.h"    // ...\mpir-2.7.2\build.vc14\lib_mpir_gc\Win32\Release

int main(const int argc, const char *argv[])
{
mpz_t bigint[2], bigres;             // Big integers
char output[512];                    // Text buffer for output
int n;

if (argc != 3)
{    printf("syntax: test <op1> <op2>\n");
    return 1;
}
mpz_init_set_str(bigint[0], argv[1], 10);        // Convert arg string 1 to 
big integer
mpz_init_set_str(bigint[1], argv[2], 10);        // Convert arg string 2 to 
big integer
for (n = 0; n < 2; n++)
{    mpz_get_str(output, 10, bigint[n]);         // Convert big int to 
string
    printf("op%d = %s\n", n, output);            // Display it
}
mpz_add(bigres, bigint[0], bigint[1]);           // Add the two big integers
mpz_get_str(output, 10, bigres);                 // Convert result to string
printf("sum = %s\n", output);                    // Display it
return 0;
}//end main()



-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to