解决undefined reference to `__fdelt_chk@GLIBC_2.15'的问题

环境配置:ubuntu 10.10

编译时遇到一个问题
undefined reference to `__fdelt_chk@GLIBC_2.15’

用strings /lib/libc.so.6 |grep GLIBC_ 查看系统glibc的版本太低了,需要更新版本
到http://www.gnu.org/software/libc/download.html下载glibc-2.20.tar.gz

  • 解压glibc-2.20.tar.gz
  • cd glibc-2.20
  • mkdir build
  • cd build
  • ../configure –prefix=/opt/glibc-2.20

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

安装GLIBC成功后,
再回到你需要编译的文件夹中,修改makefile文件,把更高版本的GLIBC链接进去,如

-L/opt/glibc-2.20/lib

参考资料
解决libc.so.6: version `GLIBC_2.14’ not found问题

你可能感兴趣的:(linux,glibc)