Re: Where is _sqrtf?
Re: Where is _sqrtf?
- Subject: Re: Where is _sqrtf?
- From: Shaun Wexler <email@hidden>
- Date: Tue, 20 Apr 2004 20:53:07 -0700
On Apr 20, 2004, at 8:13 PM, Dave Camp wrote:
> I've just created a new Cocoa Application project from the templates,
> and the link fails because it can't find _sqrtf (I do call sqrtf in my
> code).
>
> The list archives seem to suggest this may happen if certain
> optimizations are turned on and you have a pre-compiled header. I've
> tried turning off all optimization and pre-compiles, but I still have
> the error.
>
> What am I missing?
You may need to add the linker flag -lmx to your build settings to
enable single-precision functions, though some of them still seem to
work without it. See <math.h>.
If you need sqrtf, instead consider using AltiVec if at all possible.
Two rounds of Newton-Raphson results in 24 bits of precision from a
reciprocal square root estimate, and you can calculate 1-4 floats per
function call, further simplified if you use a vector/scalar union.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.