where are my friends sin,cos?

Posted by: siberia37

where are my friends sin,cos? - 05/02/2003 19:58

Ok my empeg toolchain cross compiling may be screwed up but it says it cannot find those all-important math functions sin,cos,tan etc.. when I try to compile the attached code. Is this something with my setup or can anyone else compile this?
Posted by: Daria

Re: where are my friends sin,cos? - 05/02/2003 19:59

they're in libm

link with -lm
Posted by: jaharkes

Re: where are my friends sin,cos? - 05/02/2003 20:25

As Derrick said, add -lm to the link. But be aware that ARM doesn't have a floating point co-processor and as a result every fp calculation triggers a kernel trap, which then emulates the operation for you in integer math. It will be very slow. Try to do as much as possible in simple 32-bit integer math and it will be nice and snappy.
Posted by: siberia37

Re: where are my friends sin,cos? - 06/02/2003 07:38

ok that works, it compiles but doesn't work right. I'll have to work on it more. Ya I know floating point operations are not a good idea but they can't be avoided in this case, unless someone knows of a good fixed-point library.