gcc数学函数报错

用c语言编写程序的时候,虽然加了 #include <math.h> ,gcc还是报错,undefined reference to `log',‘ceil’,之类的不识别数学函数,

此时,需要在后面加上参数 -lm ,具体格式为 :

gcc -g a.c -lm

ok

Stay hungry Stay foolish
原文地址:https://www.cnblogs.com/xiangzi888/p/2239169.html