Page 1 of 1

Link errors

Posted: Sun Mar 28, 2010 9:59 am
by Luis
Hi all, I have a little problem when building some lib from source. I'm pretty new to the ARM toolchain and I'm sorry if this has been already solved somewhere, but I couldn't find anything when using the search.

I am following the instructions provided in the portlibs wiki page, and when calling make, I get some undefined reference errors, all to standard math functions, more precisely fabs, floor, sqrt, acos, log and log10. I'm on Windows and I'm using the MSys shell to do this. I don't get these undefined reference errors when using the Eclipse NDS builder plugin, so I don't have a clue what I'm doing wrong.

Any help will be greatly appreciated :)
Many thanks in advance

Re: Link errors

Posted: Mon Mar 29, 2010 11:09 am
by WinterMute
Those are math functions provided by libm, you need to add -lm to your link line. It's generally considered to be a bad idea using floating point code on the DS since it has no FPU and uses software emulation. Your mileage may vary, floats can be useful for quick prototyping and your application may not be sufficiently cpu heavy for floats to have a detrimental effect.