undefined reference to `sqrt' 问题 在gcc下用到数学函数,如sqrt。在gcc时要加上 -lm 参数,这样告诉编译器我要用到数学函数了 。 如: gcc a.c -o a -lm