求助: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是标准库才对,不应该有问题的。
另外,你用的编译选项是什么
[解决办法]
顶楼上的..