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

今天centos新机器上运行项目的时候出现题目所示的错误,搜索后发现是底层glibc 版本太低导致。

 strings /lib64/libc.so.6 |grep GLIBC_   

使用上面的命令发现 glibc版本为 2.12  

需要下载新版本的,然后编译安装。 

wget http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz

后来有人说直接升级到2.15 就能解决,参考: http://blog.csdn.net/officercat/article/details/39520227

configure的时候,可能会出现下面的错误,提示

*** Check the INSTALL file for required versions.
checking LD_LIBRARY_PATH variable... contains current directory
configure: error: 
*** LD_LIBRARY_PATH shouldn't contain the current directory when
*** building glibc. Please change the environment variable
*** and run configure again
  • 这是你的LD_LIBRARY_PATH里的值有冲突,记得备份原来的值,然后
  • export LD_LIBRARY_PATH=/usr/local/lib

编译完之后记得把LD_LIBRARY_PATH改回去,这里修改只是为了configure通过生成makefile

  • make
  • make install

参考:  解决undefined reference to `__fdelt_chk@GLIBC_2.15'的问题  (LD_LIBRARY_PATH shouldn't contain the current directory