问题解决

我在执行如下命令的时候,出现了错误。

gcc -o main main.c -static -L. –lmylib

Linux环境下gcc静态编译/usr/bin/ld: cannot find -lc错误原因及解决方法
原因:

一般出现这个问题的时候,Makefile中肯定有-static选项。这其实是静态链接时没有找到libc.a。

解决方案:

需要安装glibc-static.xxx.rpm,如glibc-static-2.12-1.107.el6_4.2.i686.rpm,或是yum install glibc-static

todo

libc.a是啥,为什么需要这个?

-static会干啥?

glibc-static又是啥?

/usr/bin/ld: cannot find -lc错误原因及解决方法的更多相关文章

  1. Linux系统中提示/usr/bin/ld: cannot find -lxxx错误的通用解决方法

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

  2. 系统中提示未找到/usr/bin/ld: cannot find -lxxx错误的通用解决方法

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

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

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

  4. make源文件时出现 /usr/bin/ld: cannot find -lstdc++ 错误

    解决CentOS 7 中,make源文件时出现 /usr/bin/ld: cannot find -lstdc++ 错误 在CentOS 7中,使用static方法编译,需要安装static vers ...

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

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

  6. coreseek常见错误原因及解决方法

    coreseek常见错误原因及解决方法 Coreseek 中文全文检索引擎 Coreseek 是一款中文全文检索/搜索软件,以GPLv2许可协议开源发布,基于Sphinx研发并独立发布,专攻中文搜索和 ...

  7. ORA-04091错误原因与解决方法

    最近工作中写了一触发器报错:ORA-04091:table XX  is mutating, trigger/function may not see it. 下面通过官方文档及网友提供资料分析一下错 ...

  8. 【转】G++ 处理 /usr/bin/ld: cannot find -lc

    原文网址:http://blog.sina.com.cn/s/blog_67bbb71101010tto.html 用g++编译C++程序时显示出:/usr/lib/ld: cannot find - ...

  9. 解决/usr/bin/ld: cannot find -lmysqlclient错误

    类似/usr/bin/ld: cannot find -xxxx的错误有很多, 首先我们可以最简单的判断一下: 这类情况一般是由于缺乏某某库文件, 又或者可能是由于已存在的库问题版本不对造成的 一般都 ...

随机推荐

  1. 引导工具GRUB详解

    导读 引导程序是驻留在硬盘第一个扇区(MPR.主引导记录)的程序.GRUB是一个功能强大的多系统引导程序,专门处理Linux与其它操作系统共存的问题.下面就由我介绍一下grub.conf文件里的具体内 ...

  2. linux apache服务器优化建议整理(很实用)

    转载:http://www.cnblogs.com/zhongbin/archive/2013/06/11/3131865.html 1.apache服务器的time_wait过多 fin_wait1 ...

  3. tftp的安装、设置以及put、get传输实验

    tftp安装流程如下: (1)首先挂载Linux系统镜像文件到/media/cdrom/的(cdrom为在/media/下自己创建的目录) (2)进入/media/cdrom/Server/可以找到t ...

  4. Hibernate中load与get,update与merge方法的区别

    1.load()与get()的区别: (1)load()读取 User user = (User)session.load(User.class, userId); (2)get()读取 User u ...

  5. Mysql InnoDB锁

    MySQL 不同引擎的锁机制: MyISAM和MEMORY采用表级锁(table-level locking) BDB采用页面锁(page-leve locking)或表级锁,默认为页面锁 InnoD ...

  6. Java之逆向工程(1) - 反编译、修补和逆向工程技术 读书笔记

    透视JAVA——反编译.修补和逆向工程技术 读书笔记 1.  Java source is not compiled to binary machine code like C/C++ source ...

  7. Java中被你忽视的四种引用(转)

    转载自:http://blog.csdn.net/u010425776/article/details/50760053 Java的数据类型分为两类:基本数据类型.引用数据类型. 基本数据类型的值存储 ...

  8. cpu_test

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  9. 【LeetCode】77. Combinations (2 solutions)

    Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 ...  ...

  10. C#-拷贝目录内容(文件和子目录)

    /// <summary> /// 拷贝目录内容 /// </summary> /// <param name="source">源目录< ...