i get the following message from the compiler:Code:#include <math.h> float sqr(float a) { return a*a; } float length(float x1,float y1,float x2,float y2) { return sqrt(sqr(x2-x1)+sqr(y2-y1)); }
I know that sqrt is defined as double sqrt(double).Code:Undefined first referenced symbol in file sqrt /var/tmp/ccHwDVgc.o main /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crt1.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status
Could someone help me with the casting?