undefined reference to `sqrt' 问题

在gcc下用到数学函数,如sqrt。在gcc时要加上 -lm 参数,这样告诉编译器我要用到数学函数了 。
如:

原文地址:https://www.cnblogs.com/hjslovewcl/p/2314335.html