2013-08-17 135 views
3

操作系統:Linux未定義的參考符號「timer_settime @@ GLIBC_2.3.3

我試圖鏈接mips64-softmmu/qemu-system-mips64,但它導致到錯誤:

./slirp/misc.o: In function `memset': 
/usr/include/bits/string3.h:81: warning: memset used with constant zero length parameter; 
this could be due to transposed parameters 
/usr/bin/ld: ../qemu-timer.o: undefined reference to symbol '[email protected]@GLIBC_2.3.3' 
/usr/bin/ld: note: '[email protected]@GLIBC_2.3.3' is defined in DSO /lib64/librt.so.1 so try adding it to the linker command line 

/lib64/librt.so.1: could not read symbols: Invalid operation 
collect2: error: ld returned 1 exit status 
make[1]: *** [qemu-system-mips64] Error 1 
make: *** [subdir-mips64-softmmu] Error 2 

任何人都可以建議我怎麼能解決這個問題。

回答

1

問題是由編輯兩個文件,MakefileMakefile.target解決加入

LIBS+=-lz -lrt -lm

10

發生此問題是因爲rt庫不鏈接。

編輯您的qemu目錄中的Makefile.target,找到LIBS+=-lz,在此行的下面添加LIBS+=-lrt

或者說,添加下面的補丁本地

--- a/tools/qemu-xen/Makefile.target 2013-04-05 23:39:54.000000000 +0000 
+++ b/tools/qemu-xen/Makefile.target 2013-04-25 13:54:59.360000000 +0000 
@@ -206,6 +206,7 @@ 
obj-$(CONFIG_NO_KVM) += kvm-stub.o 
obj-y += memory.o 
LIBS+=-lz 
+LIBS+=-lrt 

QEMU_CFLAGS += $(VNC_TLS_CFLAGS) 
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)