安装glibc
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
·
Linux下C开发环境的搭建过程(三) (2010-12-15 21:36:07)转载
标签: linux 开发环境 c语言 glibc gcc 安装 杂谈 分类: 学无止境
Linux下C开发环境的搭建过程(三)
——安装glibc
有些软件可能要求系统的 Glibc 高于某个版本才可以正常运行,如果您的 Glibc 低于要求的版本,为了运行这些软件,您就不得不升级您的 Glibc了。比如:
qq: error while loading shared libraries: requires glibc 2.5 or later dynamic linker
您可以寻找已经编译好的rpm包或者使用源代码的方式升级Glibc。
RPM包方式安装glibc
RPM虽然比较容易安装,但就是依赖问题不好解决。给出一个下载地址:
http://mirrors.jtlnet.com/centos/5.5/os/i386/CentOS/
$ rpm –ivh glibc-2.5-49.i386.rpm
不过我用的是CentOS 4.8,貌似不能兼容……
error: Failed dependencies:
glibc-common = 2.5-49 is needed by glibc-2.5-49.i386
glibc > 2.3.4 conflicts with glibc-common-2.3.4-2.43.el4_8.3.i386
安装完成后,可以查看是否已升级:
$ ls -l /lib/libc.so.6
lrwxrwxrwx 1 root root 11 10-08 22:08 /lib/libc.so.6 -> libc-2.5.so
编译安装glibc
下载glibc
[root@localhost test]# pwd
/test
[root@localhost test]# wget http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2
下载glibc-linuxthreads
[root@localhost test]# wget http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.5.tar.bz2
解压
[root@localhost test]# tar -jvxf glibc-2.9.tar.bz2
[root@localhost test]# cd glibc-2.9
[root@localhost glibc-2.9]# tar -jvxf ../glibc-linuxthreads-2.5.tar.bz2
配置
[root@localhost glibc-2.9]# cd ..
[root@localhost test]# export CFLAGS="-g -O2 -march=i486"
[root@localhost test]# mkdir glibc-build
[root@localhost test]# cd glibc-build
[root@localhost glibc-build]# ../glibc-2.9/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
安装
[root@localhost glibc-build]# make
[root@localhost glibc-build]# make install
安装编译过程中需要注意三点:
1、要将glibc-linuxthreads解压到glibc目录下。
2、不能在glibc当前目录下运行configure。
3、否则如果出现错误:error "glibc cannot be compiled without optimization",需要加上优化开关:[root@localhost test]# export CFLAGS="-g -O2 -march=i486"
标签: linux 开发环境 c语言 glibc gcc 安装 杂谈 分类: 学无止境
Linux下C开发环境的搭建过程(三)
——安装glibc
有些软件可能要求系统的 Glibc 高于某个版本才可以正常运行,如果您的 Glibc 低于要求的版本,为了运行这些软件,您就不得不升级您的 Glibc了。比如:
qq: error while loading shared libraries: requires glibc 2.5 or later dynamic linker
您可以寻找已经编译好的rpm包或者使用源代码的方式升级Glibc。
RPM包方式安装glibc
RPM虽然比较容易安装,但就是依赖问题不好解决。给出一个下载地址:
http://mirrors.jtlnet.com/centos/5.5/os/i386/CentOS/
$ rpm –ivh glibc-2.5-49.i386.rpm
不过我用的是CentOS 4.8,貌似不能兼容……
error: Failed dependencies:
glibc-common = 2.5-49 is needed by glibc-2.5-49.i386
glibc > 2.3.4 conflicts with glibc-common-2.3.4-2.43.el4_8.3.i386
安装完成后,可以查看是否已升级:
$ ls -l /lib/libc.so.6
lrwxrwxrwx 1 root root 11 10-08 22:08 /lib/libc.so.6 -> libc-2.5.so
编译安装glibc
下载glibc
[root@localhost test]# pwd
/test
[root@localhost test]# wget http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2
下载glibc-linuxthreads
[root@localhost test]# wget http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.5.tar.bz2
解压
[root@localhost test]# tar -jvxf glibc-2.9.tar.bz2
[root@localhost test]# cd glibc-2.9
[root@localhost glibc-2.9]# tar -jvxf ../glibc-linuxthreads-2.5.tar.bz2
配置
[root@localhost glibc-2.9]# cd ..
[root@localhost test]# export CFLAGS="-g -O2 -march=i486"
[root@localhost test]# mkdir glibc-build
[root@localhost test]# cd glibc-build
[root@localhost glibc-build]# ../glibc-2.9/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
安装
[root@localhost glibc-build]# make
[root@localhost glibc-build]# make install
安装编译过程中需要注意三点:
1、要将glibc-linuxthreads解压到glibc目录下。
2、不能在glibc当前目录下运行configure。
3、否则如果出现错误:error "glibc cannot be compiled without optimization",需要加上优化开关:[root@localhost test]# export CFLAGS="-g -O2 -march=i486"
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)