undefined reference to `sqrt’ 问题
分类: C/C++ 2012-06-13 15:19 2851人阅读 评论(0) 收藏 举报
referencegcc编译器c
转自:http://hi.baidu.com/opmetic/blog/item/86c95209f8065284d0581b14.html
在gcc下用到数学函数,如sqrt。在gcc时要加上 -lm 参数,这样告诉编译器我要用到数学函数了 。
如:
gcc a.c -o a -lm