|
我想用标准库里的 pow() 函数,写了个程序如下
#include <stdio.h>
#include <math.h>
int main()
{
int i;
i = pow(2,2);
printf("2x2 is %d", i);
return 0;
}
但是gcc报错,
/tmp/ccSb96nM.o(.text+0x24): In function `main':
: undefined reference to `pow'
collect2: ld returned 1 exit status
我已经inlucde了<math.h>,为什么会出现这样的错误? |
|