Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#140659 - 05/02/2003 19:58 where are my friends sin,cos?
siberia37
old hand

Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
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?


Attachments
138840-rscalc.c (184 downloads)


Top
#140660 - 05/02/2003 19:59 Re: where are my friends sin,cos? [Re: siberia37]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
they're in libm

link with -lm

Top
#140661 - 05/02/2003 20:25 Re: where are my friends sin,cos? [Re: siberia37]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
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.
_________________________
40GB - serial #40104051 gpsapp

Top
#140662 - 06/02/2003 07:38 Re: where are my friends sin,cos? [Re: jaharkes]
siberia37
old hand

Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
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.

Top