math.h头文件怎么不起作用?

我写了个函数:
#include <stdio.h>
#include <math.h>

int main(void)
{
float f=0.5;
printf(“the sin of 0.5 is %f.\n”,sin(f));
return 1;
}
编译提示
undefined reference to “_Sin”
为什么math.h没有起作用呢,是不是还要设置一些环境变量呢?
高手指点一下,谢谢!

Linker中缺extra libraries: m ?

编译的时候加上 -lm 选项

thanks only.
it’s ok!