原文网址: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. hdu 1316 How many Fibs?(高精度斐波那契数)

    //  大数继续 Problem Description Recall the definition of the Fibonacci numbers:  f1 := 1  f2 := 2  fn : ...

  2. 重新开始学习c#啦,希望能坚持下去!

    过了这么多年,还是感觉自己喜欢C#,喜欢编程,虽然自己什么技术也没有:做的项目也不算是项目:

  3. 解决ie8下h5元素兼容性的问题

    HTML5的语义化标签以及属性,可以让开发者非常方便地实现清晰的web页面布局,加上CSS3的效果渲染,快速建立丰富灵活的web页面显得非常简单. HTML5的新标签元素有: <header&g ...

  4. 微信video标签全屏无法退出bug

    安卓(android)微信里面video播放视频,会被强制全屏,播放完毕后还有腾讯推荐的视频,非常讨厌..强制被全屏无法解决,但是视频播放完毕后退出播放器可以解决.方法就是视频播放完毕后,用音频aud ...

  5. C++ Vector

    在c++中,vector是一个十分有用的容器,下面对这个容器做一下总结. 1 基本操作 (1)头文件#include<vector>. (2)创建vector对象,vector<in ...

  6. Android LruCache究竟是什么

    源码: /frameworks/base/core/java/android/util/LruCache.java 文件开篇注释如下: A cache that holds strong refere ...

  7. Java集合Map接口与Map.Entry学习

    Java集合Map接口与Map.Entry学习 Map接口不是Collection接口的继承.Map接口用于维护键/值对(key/value pairs).该接口描述了从不重复的键到值的映射. (1) ...

  8. python 脚本

    mag3.py 1,import import sys from org.eclipse.jface.dialogs import MessageDialogfrom org.eclipse.core ...

  9. VS Extension: Create a txt file and set the content

    使用 Visual Studio Extension 创建一个文本文件,并填入内容. 需要引用 EnvDTE C:\Program Files (x86)\Microsoft Visual Studi ...

  10. Java中的编码

    package coreJava; import javax.swing.plaf.synth.SynthSpinnerUI; public class EncodeDemo { public sta ...