trouble compiling gmp-chudnovsky.c

Lloyd Standish lloyd at crnatural.net
Tue May 2 07:30:14 CEST 2006


Hello,

Thanks for a great website!

I am unable to compile gmp-chudnovsky.c on my Linux PC.  The gmp library  
compiled fine, but when I try to compile gmp-chudnovsky.c (renamed to  
pi.c) as follows:

[lloyd at localhost demos]$ [lloyd at localhost demos]$ gcc pi.c -lgmp

I get the following output:

/home/lloyd/tmp/ccGVTUBR.o: In function `my_sqrt_ui':
pi.c:(.text+0x52): undefined reference to `sqrt'
pi.c:(.text+0xdd): undefined reference to `sqrt'
/home/lloyd/tmp/ccGVTUBR.o: In function `build_sieve':
pi.c:(.text+0x1797): undefined reference to `sqrt'
collect2: ld returned 1 exit status

I can't figure out why the sqrt function seems hidden from the linker.

I'd appreciate any help.

Regards,
Lloyd


More information about the gmp-discuss mailing list