t.s
December 17th, 2007, 04:17 AM
Hi all,
I've tried to make a simple program with cosine algorithm in openSUSE 10.3. Same result with kubuntu gutsy. Both are 64 bit edition.
#include <stdio.h>
#include <math.h>
main() {
printf("Cosine from PI/1 is %f\n", cos(3.1415/1));
}
when I compile that code, it output:
/tmp/ccCcCz7R.o: In function `main':
cos.c: (.text+0x1c): undefined reference to `cos'
collect2: ld returned 1 exit status
what I know is all the math function now stored in /usr/include/bits/mathcalls.h; but it's said that I cannot use (include) it directly, rather use math.h for that. I've tried both method (include math.h and include mathcalls.h) with same result, FAIL!
Distro bugs or gnu C bug?
Any suggestion?
thanks,
t.s
I've tried to make a simple program with cosine algorithm in openSUSE 10.3. Same result with kubuntu gutsy. Both are 64 bit edition.
#include <stdio.h>
#include <math.h>
main() {
printf("Cosine from PI/1 is %f\n", cos(3.1415/1));
}
when I compile that code, it output:
/tmp/ccCcCz7R.o: In function `main':
cos.c: (.text+0x1c): undefined reference to `cos'
collect2: ld returned 1 exit status
what I know is all the math function now stored in /usr/include/bits/mathcalls.h; but it's said that I cannot use (include) it directly, rather use math.h for that. I've tried both method (include math.h and include mathcalls.h) with same result, FAIL!
Distro bugs or gnu C bug?
Any suggestion?
thanks,
t.s