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

Re: undefined reference to `ceil'



gcc -lm test_ceil.c ?
you have to link libm.a  to you program explicitely.

p

On Tue, Feb 03, 2004 at 09:07:35PM +1100, 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)
> 
> 
> --
> To UNSUBSCRIBE, email to debian-sparc-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
++ Our capacity for understanding is inversely proportional to 
   how much we think we know. The more I know, the more I know 
   I don't know...
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html



Reply to: