最近在搭建一个编译环境,遇到很多系统版本不匹配的问题。这是开源软件的一大硬伤。
/DemoService: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./DemoService)
./DemoService: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./DemoService)
./DemoService: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /lib64/libprotobuf.so.8)
./DemoService: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libltpParser.so)
./DemoService: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./libltpParser.so)
./DemoService: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /lib64/libboost_python.so.1.53.0)
./DemoService: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /lib64/libpython2.7.so.1.0)
这是个web服务,编译的时候c库是2.14版,运行的这个红帽6.6系统上glibc最高支持2.12版。
命令 strings /lib64/libc.so.6 |grep GLIBC_
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_PRIVATE
通过rpm命令查看安装包
命令rpm -qa | grep glibc
glibc-common-2.12-1.149.el6.x86_64
glibc-headers-2.12-1.149.el6.x86_64
glibc-2.12-1.149.el6.x86_64
glibc-2.12-1.149.el6.i686
glibc-devel-2.12-1.149.el6.x86_64