But for the first time I have used one of the math functions defined in the <math.h> header and get an error which I just can't solve.
Since I am learning c for both Windows and Linux I know the program works in the gcc compiler in Codeblocks for Windows.
Code: Select all
#include <math.h>
#include <stdio.h>
int main(void)
{
double x,y;
x = 5;
y = sqrt(x);
return 0;
}
Code: Select all
/tmp/ccr0Yo3k.o: In function `main':
/root/test.c:11:undefined reference to `sqrt'
collect2: ld returned 1 exit status
make: ***[all] Error 1