Hello, I am using linux 12.04 and geany for coding. The code I write in C worked completely fine until I used the sqrtf command to find the square root of the float. Error: HAC3.c :(. Text + 0xfd7): undefined reference to `sqrtf '.
Part of the code in which I am using sqrtf:
float syn(float *a, float *b, int dimensions) { float similarity=0; float sumup=0; float sumdown=0; float as=0; float bs=0; int i; for(i=0; i<dimensions; i++) { sumup = sumup + a[i] * b[i]; as = as + a[i] * a[i]; bs = bs + b[i] * b[i]; } sumdown = sqrtf(as) * sqrtf(bs); similarity = sumup / sumdown; return similarity; }
I have included math.h, but that does not seem to be the problem. So I am wondering if there is a way to fix geany so that it does not appear again? I have little knowledge, so try to explain, if possible.
captain monk
source share