GCC:undefined reference to ‘sqrt’

2016-1-13 杜世伟 C

undefined reference to `sqrt'
代码中是我是引入math.h类库的,提示没有找到!该问题为实际上没有链接math库,编译时需要加上 -lm 参数(链接math库)
通过执行 gcc -lm test02.c -o test02即可

阅读全文>>

标签: gcc sqrt

评论(0) 浏览(3774)

Powered by emlog 沪ICP备2023034538号-1