I have 2 integer variables which I want to multiply then find the square root (the geometric mean). This result needs to be saved in a double variable.

I have tried typecasting them, but something about my function isn't working right. I always get this error

Code:

Undefined first referenced
symbol in file
sqrt /tmpsort/ccAKaa8v.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

At first I thought I was typecasting wrong, but when I removed all of that and simply tried to do sqrt on a single double variable, I still hit the error.

Code:

double d, e;
d = 3.2;
e = sqrt(d);

I don't get the error if I do sqrt on a number.

Code:

double e;
e = sqrt(3.2);

I have included math.h.