1. 构建 Makefile 文件后运行错误,undefined reference to 'sqrt' 实际上是没有链接math数学库,所以要 $gcc test.c –lm //-lm就是链接到math库. 参考:C 语言 undefined reference to 'sqrt' 问题解决 参考:Why am I getting “undefined reference to sqrt” error even though I include math.h header? [duplica…