[nslu2-linux] how to include a C library with gcc on NSLU2
- Hi, I have some problem managing C library in NSLU2 . I use Unslung and have
optware-devel installed (it include gcc and glibc) but I can't include some
libraries such as math.h or stdio.h. Here my test code:
double x = sqrt (2.0);
printf ("The square root of 2.0 is %f\n", x);
and when I compile it : "gcc test.c -o test.exe" it said:
"stdio.h: No such file or directory"
"math.h : No such file or directory"
"undefined reference to `sqrt' "
When I try with another simple program using some simple function such as
printf or scanf, and delete the line #include <stdio.h> and
#include<math.h>, it work. So that means stdio's function work well but
math's function does not work properly.
Please teach me how to include library in my program, do I need to export
any PATH or enviroment. Thank you very much.
View this message in context: http://www.nabble.com/how-to-include-a-C-library-with-gcc-on-NSLU2-tf4874846.html#a13948638
Sent from the Nslu2 - Linux mailing list archive at Nabble.com.