[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: undefined reference to `ceil'



Jim,

On Linux you use -lm, but be careful if you are using Solaris, use -lmath to link to the math library.

Leith

Jim Watson wrote:
Hi,

i would appreciate some help to see if this test program is valid before i
file a bug,

thanks

jim

jim@sun:~/C$ gcc -o test_ceil test_ceil.c
/tmp/ccwfWhXU.o(.text+0x1c): In function ain':
: undefined reference to eil'
collect2: ld returned 1 exit status

jim@sun:~/C$ cat test_ceil.c
#include<math.h>
int main(void)
{
        double cvalue;
        cvalue = ceil((double)1);
}

jim@sun:~/C$ gcc --version
gcc (GCC) 3.3.3 20040125 (prerelease) (Debian)





Reply to: