刚入门学习,在C语言第一季的S1EI6课后作业里的最后一题的代码里面pow(2,i) 为啥我的机子上行不通呢,就算是复制代码编译也会显示test3.c:(.text+0x35): undefined reference to `pow'
collect2: ld returned 1 exit status
下面是鱼c的代码,请问各位你们的机子上行的通吗?
#include <stdio.h>
#include <math.h>
int main()
{
unsigned long long sum = 0;
unsigned long long temp;
unsigned long long weight;
int i;
for (i=0; i < 64; i++)
{
temp = pow(2, i);
sum = sum + temp;
}