linux 运行可执行文件version `GLIBC_2.17' not found

http://www.cnblogs.com/q191201771/p/3875316.html

root@socfpga:/media/ram/nfs/dvb# ./a.out
./a.out: /lib/libc.so.: version `GLIBC_2.' not found (required by ./a.out)
root@socfpga:/media/ram/nfs/dvb# strings /lib/libc.so.  | grep GLIBC
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_PRIVATE
GNU C Library (Ubuntu EGLIBC 2.15-0ubuntu10) stable release version 2.15, by Roland McGrath et al.
root@iZ25uck2l28Z:/tmp/tmp# nm a.out | grep GLIBC_2.
U clock_gettime@@GLIBC_2.

发现是clock_gettime有问题

@ man clock_gettime,可以看到其中有一句话

Link with -lrt (only for glibc versions before 2.17).

所以在编译a.out时添加-lrt即可

上一篇:C# 类型参数的约束


下一篇:优化有标量子查询的SQL