用c语言编写程序的时候,虽然加了 #include <math.h> ,gcc还是报错,undefined reference to `log',‘ceil’,之类的不识别数学函数,
此时,需要在后面加上参数 -lm ,具体格式为 :
gcc -g a.c -lm
ok