ldd無法找到一個dll,它出現在rpath定義中。找到一些其他庫(檢查/./../lib/*)儘管設置了rpath,但找不到一個dll
這裏是ldd的輸出(我們可以看到2個DLL在../lib中找到,但沒有找到libexpat.so.0:
根@ hyperstream:/ DT /本地/ ADE-trunk4 /集結ADE-桌面 - 缺省/倉# LDD ./ade_admin Linux的vdso.so.1 =>(0x00007ffeb9796000) libadeversion.so = > /DT/local/ADE-trunk4/build-ADE-Desktop-Default/bin/./../lib/libadeversion.so (0x00007f31abaef000)libuuid.so.1 => /lib/x86_64-linux- gnu/libuuid.so.1(0x00007f31ab8ca000) libpthread.so.0 =>/lib/x86_64-linux-gnu/libpthr ead.so.0 (0x00007f31ab6ac000)libaprutil-1.so.0 => /DT/local/ADE-trunk4/build-ADE-Desktop-Default/bin/./../lib/libaprutil-1。 so.0 (0x00007f31ab58c000)libapr-1.so.0 => /DT/local/ADE-trunk4/build-ADE-Desktop-Default/bin/./../lib/libapr-1.so 0.0 (0x00007f31ab460000)libavahi-client.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3(0x00007f31ab24d000) libavahi-common.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3(0x00007f31ab041000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2(0x00007f31aae3d000) libstdC++。so。 6 =>/usr/lib/x86_64-linux-g nu/libstdC++。so.6 (0x00007f31aaab5000)libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f31aa7ac000)libgcc_s.so.1 => /lib/x86_64-linux -gnu/libgcc_s.so.1(0x00007f31aa595000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6(0x00007f31aa1cc000) /lib64/ld-linux-x86-64.so。 2(0x0000560d30a76000)libexpat.so.0 => 未找到 librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f31a9fc4000)[...]
root @ hyperstream:/ DT/local/ADE-trunk4/build-ADE-Desktop-Default/bin# file ../lib/libexpat.so.0 ../lib/libexpat.so.0:ELF 64位LSB分享 對象,X86-64,版本1(SYSV),動態鏈接, BuildID [SHA1] = 762de704943d03033d01a9725216d6b05d0740f5,不剝離
這裏將rpath:
根@ hyperstream:/ DT /本地/ ADE-trunk4/build-ADE-Desktop-Default/bin# readelf -d ade_admin | grep的 'R. * PATH' 16:0x000000000000001d(RUNPATH) 庫運行路徑:[$ {ORIGIN} /../ lib中]
現在兇手的事實:這是鏗鏘3.8的作品,但失敗GCC 6.3(Ubuntu的16.10)
顯然添加LD_LIBRARY_PATH = ../lib目錄使其再次工作,但rpath中的目標是避免將其設置
根@ hyperstream:/ DT /本地/ ADE-trunk4/build-ADE-Desktop-Default/bin# export LD_LIB RARY_PATH = ../ lib中 根@ hyperstream:/ DT /本地/ ADE-trunk4 /集結ADE-桌面 - 缺省/倉# LDD ./ade_admin Linux的vdso.so.1 =>(0x00007ffea23b6000) libadeversion.so => ../lib/libadeversion.so(0x00007f78c6474000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f78c624f000)libpthread.so.0 => /lib/x86_64- linux-gnu/libpthread.so.0(0x00007f78c6031000) libaprutil-1.so.0 => ../lib/libaprutil-1.so.0(0x00007f78c5f11000) libapr-1.so.0 => ../ lib/libapr-1.so.0(0x00007f78c5de5000) libavahi-client.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3(0x00007f78c5bd2000) libavahi-common.so .3 => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3(0x00007f78c59c6000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2(0x00007f78c57c2000) libstdC++。 so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f78c543a000)libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f78c5131000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1(0x00007f78c4f1a000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6(0x00007f78c4b51000) /lib64/ld-linux-x86-64.so.2(0x0000559fdceab000)libexpat.so.0 => 。 ./lib/libexpat.so.0(0x00007f78c492a000)
任何想法?
問候
洛朗