Compile problem

Artyom Mkhitaryan art.mhtr at gmail.com
Tue Sep 9 16:28:54 UTC 2014


Good evening! I installed GMP on my ubuntu  but have some problems
compiling my program like:

gmp.c: In function ‘main’:
gmp.c:9:18: warning: integer constant is too large for its type [enabled by
default]
gmp.c:9:2: warning: large integer implicitly truncated to unsigned type
[-Woverflow]
/tmp/ccf6qFcG.o: In function `main':
gmp.c:(.text+0x11): undefined reference to `__gmpz_init'
gmp.c:(.text+0x25): undefined reference to `__gmpz_set_ui'
gmp.c:(.text+0x31): undefined reference to `__gmpz_clear'


program was like:

#include <stdlib.h>
#include <stdio.h>
#include <gmp.h>
#include <string.h>

int main (int argc, char **argv) {
    mpz_t numb;
    mpz_init(numb);
    mpz_set_ui(numb,99999999999999999999999999999999);
    nmpz_clear(numb);
    return 0;
}

Could you please help me?


More information about the gmp-bugs mailing list