hello, everyone,<br><br>I just want use mpn_gcd to make a program, that can calculate gcd of two big integers, the following is my code named agcd.c:<br><br><br><br>#include <stdio.h><br>#include <gmp.h><br><br>
main (int argc, char **argv)<br> {<br> mpz_t a, b, p;<br><br> if (argc != 3)<br> { printf ("Usage: %s <number> <number>\n", argv[0]); exit (1); }<br><br> /* Initialize and assign a and b from base 10 strings in argv */
<br> mpz_init_set_str (a, argv[1], 10);<br> mpz_init_set_str (b, argv[2], 10);<br> /* Initialize p */<br> mpz_init (p);<br><br><br> /* compute the gcd of a and b*/<br> mp_size_t mpn_gcd (mp_limb_t *p, mp_limb_t *a,
<br> mp_size_an, mp_limb_t *b, mp_size_t bn)<br><br> /* Print p in base 10 */<br> mpz_out_str (stdout, 10, p);<br> fputc ('\n', stdout);<br><br> /* Since we're about to exit, no need to clear out variables */
<br> exit (0);<br> }<br><br><br><br>and when compiled, got the following error:<br><br>agcd.c: In function 'main':<br>agcd.c:9: warning: incompatible implicit declaration of built-in function 'exit'<br>agcd.c:20: error: syntax error before 'mp_size_an'
<br><br><br><br><br>so, please, anyone can give me some advise about this problem, thanks!<br><br>weifeng Jiang<br>