Wei,
>
> Can someone let me know how to use sin() in my realtime task?
> My OS is Redhat 5.2 with kernel 2.0.36.
>
> In fact, I wrote the line
>
> #include <math.h)
>
> in my source file g2_m.cfor realtime module.
> And use the following line to compile it.
>
> cc -I/usr/src/rtlinux/linux/include -I//usr/src/rtlinux/rtl/include -Wall -W
> strict-prototypes -O2 -fomit-frame-pointer -fno-strength-reduce -D__RT__ -D_
> _KERNEL__ -DMODULE -c -lm g2_m.c -o g2_m.o
>
> but I got the following message:
> cc: -lm: linker input file unused since linking not done.
>
> Why?
>
You haven't done any linking because of using -c
compiler option which eliminates linking (man gcc).
If you are compiling module from several source
code files and/or source + a library, you'll need to know
something about "partial linking" (ld -r). It was
discussed couple of times here. Don't forget to say to your
RT task that FP coprocessor is in use.
I don't know if the standard math library functions
(-lm) can be used inside RT modules safely. If anybody
knows, please, drop me a line.
Regards,
..........................................................................
Pavel Andris | tel: +421 7 5941 2167
Institute of Control Theory and Robotics | fax: +421 7 376 045
Slovak Academy of Sciences |
Dubravska cesta 9 | e-mail: [EMAIL PROTECTED]
Slovakia |
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/