So I have this C code:
But gcc complains that:Code:#include<stdio.h> #include<stdlib.h> #include<math.h> double dist(int x*, int y*, int x2, int y2){ double dx = (double) (x* - x2); double dy = (double) (y* - y2); double xx = pow(dx, 2.0); double yy = pow(dy, 2.0); double distance = sqrt(xx + yy); return distance; }
I don't get why gcc would say that. Anything I missed?Code:/tmp/cck84m*o.o: In function `dist': astar.c:(.text+0x5d): undefined reference to `sqrt' collect2: ld returned * exit status



Reply With Quote