FC14下错误 /usr/bin/ld: libvalhalla-test.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.2'

转自  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601022

Linux(FC14)下编译程序时出现下面的问题:

/usr/bin/ld: libvalhalla-test.o: undefined reference to symbol
'clock_gettime@@GLIBC_2.2'
/usr/bin/ld: note: 'clock_gettime@@GLIBC_2.2' is defined in
DSO /lib/librt.so.1 so try adding it to the linker command line
/lib/librt.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

This means that libvalhalla-test has to be linked explicitly with librt,
thus the fix proposed before (another one is to add explictly -lrt in
the corresponding Makefile).

网上的说法是在makefile中加上 -lrt , 试过,确实可以。。。

发布了146 篇原创文章 · 获赞 13 · 访问量 71万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章