linux鸟哥的私房菜中 gcc 加入链接库的时候出现的异常

linux鸟哥的私房菜中 gcc 加入链接库的时候出现的错误
#include<stdio.h>
int main(){
  printf("value :  %f \n",sin(3.14/2));
  return 0;
}


这个是上面的代码,文件名就叫a.c好了
然后我
gcc a.c -lm -L/lib -L/usr/lib

但是  提示  隐式声明与内建函数 sin 不兼容。。。。。

what happens!!!!
------解决思路----------------------
#include <math.h>
------解决思路----------------------
使用数学函数了, 好像要使用 -math 把(好像是这样linux鸟哥的私房菜中  gcc 加入链接库的时候出现的异常
------解决思路----------------------
引用:
Quote: 引用:

#include <math.h>


 您好,我不是要这样的,我是想实验一下手动加入库函数,而不是直接头文件。
我上面的那个gcc命令里面的-lm就是想包含sin函数的,但是不知道是不是操作有误,总是提示不兼容,
但是我的操作都是按照标准来的呀


warning: incompatible implicit declaration of built-in function

if that's the case and you don't want to include the header file, which will suppress the warning message,  you can simply ignore the warning, your program is fine.

To explain why you got this warning:

in C language, a previously undeclared function is counted as an implicit declaration of the function and its return value is always with type int. For GCC, however, it has built-in definitions for some standard functions. If an implicit declaration does not match the built-in definition, you get this warning.
------解决思路----------------------
-lm  是链接选项,编译分为 预处理、编译、链接 几个阶段,这个错误是在编译阶段,头文件是在预处理阶段处理