原文网址:http://blog.sina.com.cn/s/blog_67bbb71101010tto.html

用g++编译C++程序时显示出:
/usr/lib/ld: cannot find -lc
/usr/lib/ld: cannot find -lgcc_s
/usr/lib/ld: cannot find -lm
/usr/lib/ld: cannot find -lgcc_s
的错误。在网上看了很多中关于/usr/lib/ld: cannot find -lXXX的解法,但是大同小异,没有很具体的讲解。所以把我的解决方法记录一下。

解决/usr/lib/ld: cannot find -lc:
1. 在系统中搜索 libc.so 文件。搜索出一个无效的链接,删除;还有一个 libc.so.6 ,在/usr/lib/i386-linux-gnu下面。
2. 进入usr/lib目录:cd /usr/lib
3.建立链接:sudo ln -sv /lib/i386-linux-gnu/libc.so.6 libc.so

解决/usr/lib/ld: cannot find -lm:
1. 在系统中搜索 libm.so 文件。搜索出一个 libm.so ,在/usr/lib/i386-linux-gnu下面。
2. 进入usr/lib目录:cd /usr/lib
3.建立链接:sudo ln -sv /usr/lib/i386-linux-gnu/libm.so libm.so

解决/usr/lib/ld: cannot find -lgcc_s:
1. 在系统中搜索 libgcc_s.so 文件。同样在/usr/lib/i386-linux-gnu下面搜索到了libgcc_s.so.1。
2. 进入usr/lib目录:cd /usr/lib
3.建立链接:sudo ln -sv /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so

当某一个链接建立成功的时候,系统显示是类似这样的:
"libgcc_s.so" -> "/lib/i386-linux-gnu/libgcc_s.so.1"

【转】G++ 处理 /usr/bin/ld: cannot find -lc的更多相关文章

  1. 【解决】/usr/bin/ld: cannot find -lc

    现象:运行gcc静态编译程序时报错: /usr/bin/ld: cannot find -lc collect2: ld returned 1 exit statusmake: *** [gcc_dr ...

  2. /usr/bin/ld: cannot find -lc错误原因及解决方法

    问题解决 我在执行如下命令的时候,出现了错误. gcc -o main main.c -static -L. –lmylib Linux环境下gcc静态编译/usr/bin/ld: cannot fi ...

  3. /usr/bin/ld: cannot find -lc

    yum install glibc-static [root@test chkrootkit-0.50]# make sensecc -static -o strings-static strings ...

  4. 编译错误 ----- /usr/bin/ld: cannot find -lc

    yum install glibc-static glib-static是Gcc链接时使用到的库.

  5. linux /usr/bin/ld cannot find 解决

    问题: 在linux环境编译应用程式或lib的source code时常常会出现如下的错误讯息: /usr/bin/ld: cannot find -lxxx 这些讯息会随着编译不同类型的source ...

  6. 【转】linux /usr/bin/ld cannot find 解决

    原文网址:http://blog.csdn.net/mzwang123/article/details/6702889 问题:在linux环境编译应用程式或lib的source code时常常会出现如 ...

  7. linux /usr/bin/ld: cannot find -lxxx

    在linux环境编译应用程式或lib的source code时出现如下错误:/usr/bin/ld: cannot find -lxxx 这些讯息会随着编译不同类型的source code 而有不同的 ...

  8. 关于usr/bin/ld: cannot find -lxxx问题总结

    /usr/bin/ld: cannot find -lxxx问题总结   linux下编译应用程序常常会出现如下错误:     /usr/bin/ld: cannot find -lxxx       ...

  9. 【转】关于usr/bin/ld: cannot find -lxxx问题总结

    原文网址:http://eminzhang.blog.51cto.com/5292425/1285705 /usr/bin/ld: cannot find -lxxx问题总结   linux下编译应用 ...

随机推荐

  1. How to enable $Admin Shares in Windows 7

    Quote from: http://www.wintips.org/how-to-enable-admin-shares-windows-7/ As “Administrative shares” ...

  2. 以boost::function和boost:bind取代虚函数

    转自:http://blog.csdn.net/Solstice/archive/2008/10/13/3066268.aspx 这是一篇比较情绪化的blog,中心思想是“继承就像一条贼船,上去就下不 ...

  3. Poj 1013 Counterfeit Dollar / OpenJudge 1013(2692) 假币问题

    1.链接地址: http://poj.org/problem?id=1013 http://bailian.openjudge.cn/practice/2692 http://bailian.open ...

  4. mysql常见的hint(转载的)

    mysql常用的hint对于经常使用oracle的朋友可能知道,oracle的hint功能种类很多,对于优化sql语句提供了很多方法.同样,在mysql里,也有类似的hint功能.下面介绍一些常用的. ...

  5. PHPstrom2016.1激活与汉化【2016.06.21依旧可用】

    : 目前的网络上有很多的关于PHPstrom激活的方法,但是很多都失效了,没有具体的使用日期,这个是我从其他网友那里转载过来的,具体地址忘记了: 方法如下: 需要在联网条件下,打开PHPstrom,在 ...

  6. Qt-获取网络接口信息的综合示例

    在前面的文章中介绍了与 获 取 本 机 网 络 信 息 相 关 的 类 常 用 的 有 4 个 , 分 别 是 : QHostAddress, QHostInfo, QNetworkInterface ...

  7. cookie、localStorage、sessionStorage之间的区别

    sessionStorage 和 localStorage 是HTML5 Web Storage API 提供的,可以方便的在web请求之间保存数据.有了本地数据,就可以避免数据在浏览器和服务器间不必 ...

  8. ie6下 gif动画不动

    ie6下 gif动画不动 如果有onclick事件:在IE6中,点击a标签,onclick事件会先执行,其次是href下的动作,href执行后,默认会执行跳转动作(尽管href属性不一定是一个地址), ...

  9. Nginx+Keepalived主备负载均衡

    实验环境及软件版本: CentOS版本:    6.6(2.6.32.-504.el6.x86_64) nginx版本:     nginx-1.6.2 keepalived版本:keepalived ...

  10. Hadoop 2.4.0完全分布式平台搭建、配置、安装

    一:系统安装与配置 Hadoop选择下载2.4.0 http://hadoop.apache.org / http://mirror.bit.edu.cn/apache/hadoop/common/h ...