![如何编译 bbcp 以便它查找本地库?](https://linux22.com/image/120505/%E5%A6%82%E4%BD%95%E7%BC%96%E8%AF%91%20bbcp%20%E4%BB%A5%E4%BE%BF%E5%AE%83%E6%9F%A5%E6%89%BE%E6%9C%AC%E5%9C%B0%E5%BA%93%EF%BC%9F.png)
我编译了 bbcp 但失败了,因为缺少 libcrypto.so.10
bash-3.2$ ./bbcp
./bbcp: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory
当我检查它时:
bash-3.2$ ldd ./bbcp
linux-vdso.so.1 => (0x00007fffc33fc000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x000000377ca00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000377a200000)
librt.so.1 => /lib64/librt.so.1 (0x000000377aa00000)
libz.so.1 => /usr/lib64/libz.so.1 (0x000000377a600000)
libcrypto.so.10 => not found
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00000036eda00000)
libm.so.6 => /lib64/libm.so.6 (0x0000003012200000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000377d200000)
libc.so.6 => /lib64/libc.so.6 (0x0000003779600000)
/lib64/ld-linux-x86-64.so.2 (0x0000003779200000)
现在我获取了二进制文件并将其复制到本地,但bbcp
仍然看不到它。
如何编译它以便它在本地查找链接库(与 bbcp 工具相同的目录)?
答案1
设置 LD_LIBRARY_PATH 指向本地库位置:
导出 LD_LIBRARY_PATH=~/lib