解决libc.so.6: version `GLIBC_2.14′ not found问题

来源:互联网 发布:积分管理数据库设计 编辑:程序博客网 时间:2024/06/05 23:13

解决libc.so.6: version `GLIBC_2.14′ not found问题

2013年08月18日 ⁄ 综合⁄ 共 3010字 ⁄ 字号小 中 大评论关闭

0.以下在系统CentOS 6.3 x86_64上操作

1.试图运行程序,提示"libc.so.6: version `GLIBC_2.14' not found",原因是系统的glibc版本太低,软件编译时使用了较高版本的glibc引起的:

[ghui@StuOS bin]$ pwd/var/VMdisks/cross/mingw32/bin[ghui@StuOS bin]$ lslrelease     QtCore4.dll         QtNetwork4.dll      QtSql4.dll     QtXml4.dllmoc          QtDeclarative4.dll  QtOpenGL4.dll       QtSvg4.dll     rccphonon4.dll  QtGui4.dll          QtScript4.dll       QtTest4.dll    uicqmake        QtMultimedia4.dll   QtScriptTools4.dll  QtWebKit4.dll[ghui@StuOS bin]$ ./qmake ./qmake: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./qmake)

2.查看系统glibc支持的版本:

[ghui@StuOS bin]$ strings /lib64/libc.so.6 |grep GLIBC_GLIBC_2.2.5GLIBC_2.2.6GLIBC_2.3GLIBC_2.3.2GLIBC_2.3.3GLIBC_2.3.4GLIBC_2.4GLIBC_2.5GLIBC_2.6GLIBC_2.7GLIBC_2.8GLIBC_2.9GLIBC_2.10GLIBC_2.11GLIBC_2.12GLIBC_PRIVATE
[ghui@StuOS bin]$ rpm -qa |grep glibcglibc-static-2.12-1.80.el6_3.6.x86_64glibc-headers-2.12-1.80.el6_3.6.x86_64glibc-common-2.12-1.80.el6_3.6.x86_64glibc-devel-2.12-1.80.el6_3.6.x86_64glibc-static-2.12-1.80.el6_3.6.i686glibc-devel-2.12-1.80.el6_3.6.i686glibc-2.12-1.80.el6_3.6.i686glibc-2.12-1.80.el6_3.6.x86_64

3.可以看到最高只支持2.12版本,所以考虑编译解决这个问题:

       a. 到http://www.gnu.org/software/libc/下载最新版本,我这里下载了glibc-2.14.tar.xz 这个版本,解压到任意目录准备编译

       b.这里解压到/var/VMdisks/glibc-2.14/

[ghui@StuOS bin]$ cd /var/VMdisks/glibc-2.14/[ghui@StuOS glibc-2.14]$ pwd/var/VMdisks/glibc-2.14[ghui@StuOS glibc-2.14]$ lsabilist            config.h.in           intl           README.libmabi-tags           config.log            io             resolvaclocal.m4         config.make.in        libc-abis      resourceaout               configure             libidn         rtargp               configure.in          libio          Rulesassert             conform               LICENSES       scriptsautom4te.cache     CONFORMANCE           locale         setjmpbits               COPYING               localedata     shadowBUGS               COPYING.LIB           login          shlib-versionsbuild              cppflags-iterator.mk  mach           signalCANCEL-FCT-WAIVE   crypt                 Makeconfig     socketCANCEL-FILE-WAIVE  csu                   Makefile       soft-fpcatgets            ctype                 Makefile.in    stdio-commonChangeLog          debug                 Makerules      stdlibChangeLog.1        dirent                malloc         streamsChangeLog.10       dlfcn                 manual         stringChangeLog.11       elf                   math           sunrpcChangeLog.12       extra-lib.mk          misc           sysdepsChangeLog.13       extra-modules.mk      NAMESPACE      sysvipcChangeLog.14       FAQ                   NEWS           termiosChangeLog.15       FAQ.in                nis            test-skeleton.cChangeLog.16       gmon                  NOTES          timeChangeLog.17       gnulib                nptl           timezoneChangeLog.2        grp                   nptl_db        tls.make.cChangeLog.3        gshadow               nscd           version.hChangeLog.4        hesiod                nss            Versions.defChangeLog.5        hurd                  o-iterator.mk  wcsmbsChangeLog.6        iconv                 po             wctypeChangeLog.7        iconvdata             posix          WUR-REPORTChangeLog.8        include               PROJECTSChangeLog.9        inet                  pwdconf               INSTALL               README

      c.在glibc源码目录建立构建目录,并cd进入构建目录

[ghui@StuOS glibc-2.14]$ mkdir build
[ghui@StuOS glibc-2.14]$ cd build

    d.运行configure配置,make && sudo  make install

[ghui@StuOS build]$ ../configure --prefix=/opt/glibc-2.14[ghui@StuOS build]$ make -j4 [ghui@StuOS build]$ sudo make install[sudo] password for ghui: 

4.临时修改环境变量

[ghui@StuOS bin]$ export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH
[ghui@StuOS glibc-2.14]$ cd /var/VMdisks/cross/mingw32/bin/

[ghui@StuOS bin]$ ./qmake Usage: ./qmake [mode] [options] [files]QMake has two modes, one mode for generating project files based onsome heuristics, and the other for generating makefiles. Normally youshouldn't need to specify a mode, as makefile generation is the defaultmode for qmake, but you may use this to test qmake on an existing project...

此时运行正常,问题解决。

By ghui

iomato.dev@Gmail.com

00:10 - 2013-01-04

0 0
原创粉丝点击