如何编译 bbcp 以便它查找本地库?

如何编译 bbcp 以便它查找本地库?

我编译了 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

相关内容