Whenever I include math.h to my c code I can't compile without the -lm option. I get this error message:
d.o: In function `refresh_position':
d.c:(.text+0x4df): undefined reference to `sqrt'
d.c:(.text+0x524): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
I can compile it with just typing -lm but my teacher says that if code doesn't work i will get 0 point from that homework. I want to know is this error occurs because of my code or because of my computer or c library. I have to be sure about it will run without any error on my teachers computer.