我尝试从源代码编译 VTK,但收到以下错误。我运行的是 Fedora 27,内核版本 4.14.11-300.fc27.x86_64
/usr/lib64/libSM.so: undefined reference to `uuid_generate@UUID_1.0'
/usr/lib64/libSM.so: undefined reference to `uuid_unparse_lower@UUID_1.0'
ldd /usr/lib64/libSM.so
节目
$ldd /usr/lib64/libSM.so
linux-vdso.so.1 (0x00007ffd4998b000)
libICE.so.6 => /lib64/libICE.so.6 (0x00007f3aa36ff000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f3aa34fa000)
libc.so.6 => /lib64/libc.so.6 (0x00007f3aa3115000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3aa3b23000)
进一步查看libuuid.so.1中的符号显示
$objdump -T /lib64/libuuid.so.1 | grep 'uuid_generate$'
0000000000002370 g DF .text 0000000000000087 UUID_1.0 uuid_generate
$objdump -T /lib64/libuuid.so.1 | grep 'uuid_unparse_lower'
0000000000002710 g DF .text 0000000000000002 UUID_1.0 uuid_unparse_lower
的输出ldconfig
是
$sudo ldconfig -p | grep libuuid
libuuid.so.1 (libc6,x86-64) => /lib64/libuuid.so.1
libuuid.so.1 (libc6) => /lib/libuuid.so.1
$ sudo ldconfig -p | grep libSM
libSM.so.6 (libc6,x86-64) => /lib64/libSM.so.6
libSM.so.6 (libc6) => /lib/libSM.so.6
libSM.so (libc6,x86-64) => /lib64/libSM.so
我不确定这里发生了什么。有人可以帮忙吗?
谢谢森蒂尔
答案1
尝试在链接中添加 -luuid。根据我对 *.so 文件的理解,您不必这样做,但就我而言,它解决了类似的问题。