Altera_Forum
Honored Contributor
19 years agohow to link math.h
hi all
When I run a program with trigonometric function like sin, cos,tan etc.. I get errors: <div class='quotetop'>QUOTE </div> --- Quote Start --- [jay@localhost test]$ nios2-linux-uclibc-gcc test.c -o test -elf2flt test.elf2flt(.text+0x6c): In function `main': : undefined reference to `sin' collect2: ld returned 1 exit status[/b] --- Quote End ---#include<math.h># include<tgmath.h>
main()
{
double angle;
angle = asin (60);
printf("angle = %f\n",angle);
} What should I do? thx in advance !