gpt4 book ai didi

linux - 对符号 'timer_settime@@GLIBC_2.3.3 的 undefined reference

转载 作者:IT王子 更新时间:2023-10-29 00:49:57 25 4
gpt4 key购买 nike

操作系统:Linux

我正在尝试链接 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 'timer_settime@@GLIBC_2.3.3'
/usr/bin/ld: note: 'timer_settime@@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

任何人都可以建议我如何解决这个问题。

最佳答案

出现这个问题是因为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)

关于linux - 对符号 'timer_settime@@GLIBC_2.3.3 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18286738/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com