原文网址: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. OpenJudge/Poj 1753 Flip Game

    1.链接地址: http://bailian.openjudge.cn/practice/1753/ http://poj.org/problem?id=1753 2.题目: 总时间限制: 1000m ...

  2. Unix/Linux之命令备忘录

    ps:是显示瞬间进程的状态,并不动态连续 kill:用于杀死进程或者给进程发送信号 // 在Linux下查看所有java进程命令 ps -ef | grep java: //  停止所有java进程命 ...

  3. linux RedHat6.4下nginx安装

    安装rpm 检测是否有已安装rpm包: rpm–qa | grep pcre rpm–qa | grep zlib rpm–qa | grep openssl 若没有则需安装(这些包可以在redhat ...

  4. Java知识总结--Servlet&JSP

    1MVC的各个部分都有哪些技术来实现?如何实现? MVC是Model-View-Controller的简写.“Model”代表的是应用的业务逻辑(通过JavaBean,EJB组件实现),“View”是 ...

  5. Angular 动态生成html中 ng-click无效

    bodyApp.controller('customersCtrl', function ($scope, $http, cfpLoadingBar,$compile) { $scope.test = ...

  6. [旧博客]Python 第一次

    决定学习Python,发现其需要安装的东西很小,只需要在官方网站下载和15MB左右的安装包,Python for windows.安装完毕就双击IDE快捷方式就打开IDE了. 你很发现IDE好像很面熟 ...

  7. 上传图片+浏览+裁切 Demo(无后台处理部分)

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. 【转】oracle 针对中文字段进行排序

    1)按笔画排序 select * from Table order by nlssort(columnName,'NLS_SORT=SCHINESE_STROKE_M') 2)按部首排序 select ...

  9. Git权威指南 读笔(1)

    第四章 Git初始化: 设置Git当前用户和邮件地址: $ git config --global user.name $ git config --global user.email 设置Git命令 ...

  10. I2C总线模拟(郭天祥视屏)

    电路图 思路 1.向EEPROM中通过I2C总线写入一个字节 2.通过I2C总线读出写入的字节 3.如果写入和读出成功点亮发光二极管 程序 #include <REGX51.H> #def ...