LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 917|回复: 1

Redhat 9.0 下C编程出现不能调用数学函数的问题, 求助!!!!!!!!!!!

[复制链接]
发表于 2004-4-5 20:02:00 | 显示全部楼层 |阅读模式
:help
在Redhat 9.0使用C编程时出现很奇怪的错误, 不能够调用数学函数, 所有的数学函数都不能用,例如:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
printf("%f",atan(100));
}

使用gcc编译时出现如下问题:
/tmp/ccPnndKq.o(.text+0x19): In function `main':
: undefined reference to `atan'
collect2: ld returned 1 exit status

请求某位大侠帮帮我!!!!!!!!!!!
发表于 2004-4-5 20:09:21 | 显示全部楼层
后面加个-lm就可以了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表