Subject: Newbie: gcc can't link with math.h functions?
From: Benoit Nadeau (nadeau.benoit@sympatico.ca)
Date: Sat Nov 03 2001 - 19:37:53 MST
OK. This is weird.
I have this:
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv)
{
printf("%f", ceil((double)(1.3)));
return 0;
}
Then, I enter "gcc test.c -o test", and it gives me this output:
/tmp/ccHB40rg.o: In function `main':
/tmp/ccHB40rg.o(.text+0x24): undefined reference to `ceil'
/tmp/ccHB40rg.o(.text+0x24): relocation truncated to fit:
R_PPC_REL24 ceil
collect2: ld returned 1 exit status
I'm using YDL 2.0 and I have the 2.95.3-2u gcc packages.
What should I do? (apart from downloading new versions of
gcc, unless you know a place other than linuxppc.org,
because its ftp site is down)
(P.S.: I'll have to re-subscribe tomorrow with a *@mac.com
address, but I'm the same guy)
Thanks,
- Benad
This archive was generated by hypermail 2a24 : Sat Nov 03 2001 - 19:50:26 MST