Tried the example on the reference, see below. Getting error message as below. Any idea why?
Undefined first referenced
symbol in file
sqrt /var/tmp//ccCiXlKb.o
ld: fatal: Symbol referencing errors. No output written to sqr
collect2: ld returned 1 exit status
/* sqrt example */
#include <stdio.h>
#include <math.h>
int main ()
{
double param, result;
param = 1024.0;
result = sqrt (param);
printf ("sqrt(%lf) = %lf\n", param, result );
return 0;
}
Sorry I do not get this. Probably I am the dummiest in this field. All I need is to compile and run the probram to get sqrt of any value. The link to the math.h exists in my directory. But, I am getting the same compilation errors. I need a clear step by step instructions.