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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章