Re: sinf(), cosf() et al
Re: sinf(), cosf() et al
- Subject: Re: sinf(), cosf() et al
- From: Cameron Hayne <email@hidden>
- Date: Tue, 22 Oct 2002 07:48:37 -0400
On 22/10/02 6:41 am, "Philippe C.D. Robert" <email@hidden> wrote:
>
I have troubles using sinf(), cosf() on Jaguar, although I include
>
<math.h>. I get:
>
G3DTrigonometry.m:81: warning: implicit declaration of function `cosf'
>
G3DTrigonometry.m:92: warning: implicit declaration of function `sinf'
>
...
>
ld: warning prebinding disabled because of undefined symbols
>
ld: Undefined symbols:
>
_cosf
>
_sinf
>
/usr/bin/libtool: internal link edit command failed
>
>
What header is required, what framework do I have to add to the project
>
in addition?
This seems like a bug (missing header files) since the documentation claims
that sinf etc are supported:
http://developer.apple.com/techpubs/macosx/DeveloperTools/gcc3/gcc/Other-Bui
ltins.html
But that document and a look at the header files provided a workaround which
you could use until it gets fixed: use '__builtin_sinf' instead of 'sinf',
etc. Here's a test program that works for me - provided I save it as a .cpp
file so that g++ gets used for compiling instead of gcc.
--------------------------
#include <stdio.h>
#include <math.h>
#define sinf __builtin_sinf
int main(void)
{
for (float x = 0.0; x < 1.0; x += 0.1)
printf("sinf(%f) = %f\n", x, sinf(x));
return 0;
}
--------------------------
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.