首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

undefined reference to `pow'

2012-07-31 
求助:undefined reference to `pow#include stdio.h#include math.hint main(){double a 10.0,b

求助:undefined reference to `pow'
#include <stdio.h>
#include <math.h>

int main()
{
  double a = 10.0,b = 3.0;
  float c;
  c = pow(a,b);
  printf("%f\n",c);
}
编译结果:
/tmp/ccibw7gz.o: In function `main':
test.c:(.text+0x2d): undefined reference to `pow'
collect2: ld returned 1 exit status
这是怎么回事? /usr/include/下面也有math.h这个文件

[解决办法]
那你就嗖嗖math.h,看里面有没有pow吧,按道理说pow是标准库才对,不应该有问题的。

另外,你用的编译选项是什么
[解决办法]
顶楼上的..

热点排行