I've installed on my ubuntu gmp using this command:
sudo apt-get install libgmp3-dev
and it worked fine. Now I'm trying to create a new project put simply writing
#include "gmp.h"
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(){
mpz_t num;
mpz_init(num);
printf("%s\n",mpz_get_str (NULL, 10, num));
mpz_clear(num);
return 0;
}
give me
> gcc -lgmp mil.c /tmp/ccHvV9kT.o: In function `main':
> mil.c:(.text+0x1f): undefined reference to `__gmpz_init'
> mil.c:(.text+0x35): undefined reference to `__gmpz_get_str'
> mil.c:(.text+0x49): undefined reference to `__gmpz_clear' collect2:
> error: ld returned 1 exit status
I just copy-pasted the code of my previous project and I get the same error(in all the function that I created), but compiling my old project I don't get any error. What is my problem???