When attempting to call functions in math.h
, I'm getting link errors like the following
undefined reference to sqrt
But I'm doing a #include <math.h>
I'm using gcc and compiling as follows:
gcc -Wall -D_GNU_SOURCE blah.c -o blah
Why can't the linker find the definition for sqrt
?