linux下C编程 undefined reference to&#..
时间:2009-03-23 来源:sjhf
我编了一个程序,使用数学函数,可是始终通过不了. 后来,我用exp函数,好像gcc都编译不过去. 程序很简单: #include <stdio.h>; #include <math.h>; main() { printf("%f", exp(3)); } 出错消息是:undefined reference to'exp' 这不是标准库函数吗?怎么用不了? 解决答案是:gcc -lm filename.c 就这么简单! |
相关阅读 更多 +