>From "man cos", cos(3C):
NAME
cos, cosf, cosl - cosine function
SYNOPSIS
cc [ flag... ] file... -lm [ library... ]
[ ... ]
Link with libm, as the documentation says, and you'll get it.
FrankH.
> I'm programming C in Sun Studio.
> when I wrote some thing like:
> // Start my code
> #include <stdio.h>
> #include <stdlib.h>
> #include<math.h>
> #define PI 3.1415926535
> int main(int argc, char** argv) {
> printf("\n %d ",acos(PI));
> return (EXIT_SUCCESS);
> }
> // End of my code
>
> And when I make it, it take me some failed :
> "
> Undefined first referenced
> symbol in file
> acos GNU-sparc-Solaris/cos.o
> ld: fatal: Symbol referencing errors. No output written to
GNU-sparc-Solaris/cos
> collect2: ld returned 1 exit status
> *** Error code 1
> dmake: Fatal error: Command failed for target `GNU-sparc-Solaris/cos'
> "
>
> Could you help me!!!
>
> Thanks & regard!!
>
>
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
--------------------------------------------------------------------------
If anything's worth doing, do it with all your heart. The Buddha
Wheresoever you go, go with all your heart. Confucius
Whatever you do, do it with all your heart. St.Paul, Col 3:23
--------------------------------------------------------------------------
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code