zoukankan      html  css  js  c++  java
  • 【转】G++ 处理 /usr/bin/ld: cannot find -lc

    原文网址: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"

  • 相关阅读:
    EMC、Pure和NetApp推新品,NAS闪存场景在哪里
    Tomcat 开启Gzip压缩
    win10+ubuntu双系统安装方案
    游戏中水的渲染技术系列一
    什么时候用到线程
    高并发和多线程
    angularJS双向绑定和依赖反转
    javascript ES6
    angularJS核心原理
    javascript限定输入textarea输入长度
  • 原文地址:https://www.cnblogs.com/wi100sh/p/4314638.html
Copyright © 2011-2022 走看看