This question already has an answer here: sqrt from math.h ... The math library must be linked in when ...
stackoverflow.com