C development environment under Linux setup process
– install glibc
Some software may require that your system’s Glibc be higher than a certain version to work, and if your Glibc is lower than the required version, you will have to upgrade your Glibc in order to run the software. Such as:
Error while loading Shared Libraries: Requires glibc 2.5 or later Dynamic Linker
You can look for compiled RPM packages or use source code to upgrade Glibc.
RPM package glibc
RPM is relatively easy to install, but the dependency problem is difficult to solve. Give a download address:
http://mirrors.jtlnet.com/centos/5.5/os/i386/CentOS/
$ RPM – the ivh glibc 2.5-49.. I386 RPM b>
But I’m using CentOS 4.8 and it doesn’t seem to be compatible…
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. The i386
After the installation is complete, you can check whether you have upgraded:
$ ls -l /lib/libc.so.6
lrwxrwxrwx 1 root root 11 10-08 22:08 /lib/libc.so.6 -> Libc – 2.5. So
compile and install glibc
Download the glibc
[root@localhost test]# pwd
/test
[root @ localhost test] # wget http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2 b>
Download the glibc – linuxthreads
[root @ localhost test] # wget http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.5.tar.bz2 b>
Unpack the
[root-@localhost test]# tar-jvxf glibc-2.9.tar.bz2
[root @ localhost test] # CD glibc 2.9 b>
[root-@localhost glibc-2.9]# tar-jvxf../glibc – linuxthreads – 2.5. Tar..bz2 b>
configuration
[root @ localhost glibc 2.9] # CD..
[root@localhost test]# exportCFLAGS=”-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 — enabling -add-ons –with-headers=/usr/include –with-binutils=/usr/bin
The installation
[root@localhost glibc-build]# make
[root@localhost glibc-build]# make install
Three points should be paid attention to during installation and compilation:
1. To unzip glibC-LinuxThreads into glibc directory.
2. Cannot run configure in glibc’s current directory.
Otherwise, if there is an error: error “Glibc cannot be Compiled without optimization”, please add the optimization switch: [root-@localhost test]# export CFLAGS=” -g-O2-March =i486″
Reproduced in: https://blog.51cto.com/rockhooray/787500