version `GLIBC_2.14' not found 解决方法.
一般出现类似次问题是当前运行系统Glibc版本低于编译环境Glibc版本造成Glibc版本兼容性造成的.# objdump -p app ... Version References: required from libc.so.6: 0x06969194 0x00 05 GLIBC_2.14 0x0d696913 0x00 04 GLIBC_2.3 0x0d696914 0x00 03 GLIBC_2.4 0x09691a75 0x00 02 GLIBC_2.2.5
# nm app |grep GLIBC_2.14 ... U memcpy@@GLIBC_2.14 ...
# objdump -T app |grep GLIBC_2.14 ... 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.14 memcpy ...
# gcc --print-file-name=libc.so /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libc.so # file /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libc.so /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libc.so: ASCII text -bash-4.1# cat /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libc.so /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) -bash-4.1# file /lib64/libc.so.6 /lib64/libc.so.6: symbolic link to `libc-2.16.so'
-bash-4.1# nm /lib64/libc-2.16.so |grep memcpy ... 000000000008a6d0 i memcpy@@GLIBC_2.14 0000000000084ab0 i memcpy@GLIBC_2.2.5 ...
再次查看app信息.
#objdump -p app ... Version References: required from libc.so.6: 0x0d696913 0x00 04 GLIBC_2.3 0x0d696914 0x00 03 GLIBC_2.4 0x09691a75 0x00 02 GLIBC_2.2.5
# objdump -T app |grep memcpy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memcpy
至此完美解决. 再次运行app一切完美. :)
参考:
http://www.trevorpounds.com/blog/?p=103
http://www.trevorpounds.com/blog/?tag=symbol-versioning
http://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_25.html
http://web.eecs.umich.edu/~prabal/teaching/eecs373-f10/readings/Linker.pdf
http://www.technovelty.org/c/symbol-versions-and-dependencies.html