GP32 Sqrt Function


dieu666

Still Fresh
Joined
Jan 22, 2004
Messages
29
There's something I don't understand with sqrt, I can't use it with anything else than const, for example, when I try:

double f = 5.3;
sqrt(f);

it tells me:
undefined reference to sqrt
but when I do this:

sqrt(10);

it's working fine.
Am I using a wrong way to find square root? if yes how can you do it?
 
dieu666 posted on Jul 17 2004 at 05:10 PM said:
There's something I don't understand with sqrt, I can't use it with anything else than const, for example, when I try:

double f = 5.3;
sqrt(f);

it tells me:
undefined reference to sqrt
but when I do this:

sqrt(10);

it's working fine.
Am I using a wrong way to find square root? if yes how can you do it?
maybe it prescalculates sqrt(10), hence it's not really using the function?

don't know. have you added -lm to link in the maths library?
 
Last edited by a moderator:
thank you, I just forgot to add -lm lol, to me makefile and chinese are the same thing :D
 
Back
Top