【错误笔记】undefined reference to `sqrt' collect2: ld returned 1 exit status
来源:互联网 发布:淘宝店铺综合评分497 编辑:程序博客网 时间:2024/05/22 00:49
今天在使用 sqrt() 函数做运算时,竟然遇到了编译错误,还是用的少啊,导致很多的知识漏洞,周末给自己做点大补汤给自己补补,希望以后在遇到这种情况时,不要在依赖搜索引擎。
测试程序代码如下:
编译错误如下:
undefined reference to `sqrt'
collect2: ld returned 1 exit status
解决方案:
gcc 加上 -lm
1 0
- 【错误笔记】undefined reference to `sqrt' collect2: ld returned 1 exit status
- undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
- undefined reference to `libiconv_open' collect2: ld returned 1 exit status
- undefined reference to `pthread_create' collect2: ld returned 1 exit status
- GCC 中 undefined reference to ‘ceil’ collect2:ld returned 1 exit status 错误
- GCC 中 undefined reference to ‘ceil’ collect2:ld returned 1 exit status 错误
- 编译器错误:/tmp/ccyOgqYQ.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
- pthread线程创建出现undefined reference to `pthread_create' collect2: error: ld returned 1 exit status
- undefined reference to `typeinfo for IA' collect2: ld returned 1 exit status
- Linux gcc编译提示:undefined reference to `sqrtf' collect2: error: ld returned 1 exit status
- undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit stat
- collect2: ld returned 1 exit status错误.
- collect2: ld returned 1 exit status错误.
- cocos2dx向android平台移植出现问题undefined reference to 'sqlite3_close' collect2: ld returned 1 exit status
- QT编译错误:collect2: ld returned 1 exit status
- Android 编译错误:collect2: ld returned 1 exit status
- QT中的error: collect2: ld returned 1 exit status错误
- error: collect2: ld returned 1 exit status 错误
- C#操作XML文档(1)
- label自适应宽度
- Android如何防止apk程序被反编译
- bootstrap下 图片轮播的实现
- Struts2防止form表单重复提交
- 【错误笔记】undefined reference to `sqrt' collect2: ld returned 1 exit status
- 基于CI框架 MVC模式下 的初次网站搭建
- 如何将GridViewEX升级到UWP(Universal Windows Platform)平台
- UVA 679
- Eclipse汉化过程
- 关于UIAlertController的使用
- android照相、相册获取图片剪裁部分手机异常的解决方法
- linux useful commands
- HTML页面加载和解析流程