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
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…