warning: libssl.so.1.0.0, needed by ……lib/libcurl.so, not found (try using -rpath or -rpath-link)

编译libs3的时候遇到:

build/bin/s3: Building executable
/usr/bin/ld: warning: libssl.so.1.0.0, needed by /home/zoltar/anaconda/lib/libcurl.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libcrypto.so.1.0.0, needed by /home/zoltar/anaconda/lib/libcurl.so, not found (try using -rpath or -rpath-link)
/home/zoltar/anaconda/lib/libcurl.so: undefined reference to `SSL_connect'
/home/zoltar/anaconda/lib/libcurl.so: undefined reference to `X509_check_issued'


解决办法:

step1:查看libcurl.so都连到哪些库:ldd /home/zoltar/anaconda/lib/libcurl.so

[root@fdg73111 libs3]# ldd /home/zoltar/anaconda/lib/libcurl.so
        linux-vdso.so.1 =>  (0x00007ffff07ff000)
        libssl.so.1.0.0 => /home/zoltar/anaconda/lib/./libssl.so.1.0.0 (0x00007f3c5bb8d000)
        libcrypto.so.1.0.0 => /home/zoltar/anaconda/lib/./libcrypto.so.1.0.0 (0x00007f3c5b7b1000)

        libz.so.1 => /home/zoltar/anaconda/lib/./libz.so.1 (0x00007f3c5b59b000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f3c5b37b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f3c5afe6000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f3c5ade2000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3c5abc5000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003adda00000)

step2:查看该路径下是否有这些so

[root@fdg73111 src]# ll /home/zoltar/anaconda/lib/./libss*
-rw-r--r-- 2 root root 748682 Mar 11  2015 /home/zoltar/anaconda/lib/./libssl.a
lrwxrwxrwx 1 root root     15 Apr 24  2015 /home/zoltar/anaconda/lib/./libssl.so -> libssl.so.1.0.0
-rwxr-xr-x 2 root root 483420 Mar 11  2015 /home/zoltar/anaconda/lib/./libssl.so.1.0.0

step3:上一步显示已经安装openssl,这一步将lib路径加到系统可查找的库路径中

[root@fdg73111 src]# vim /etc/ld.so.conf.d/libc.conf

添加一行:/home/zoltar/anaconda/lib

step4:执行ldconfig,然后重新编译libs3即可。


或者采用临时的env变量:[root@fdg73111 libs3]# export LD_LIBRARY_PATH=/home/zoltar/anaconda/lib/



[root@fdg73111 libs3]# s3 -u list
s3: error while loading shared libraries: libs3.so.2: cannot open shared object file: No such file or directory

还出类似的错,

找到libs3.so.2的位置:

[root@fdg73111 src]# ll /usr/lib/libs3.*
-rw-r--r-- 1 root root 114076 Feb 29 21:32 /usr/lib/libs3.a
lrwxrwxrwx 1 root root     10 Feb 29 21:32 /usr/lib/libs3.so -> libs3.so.2
lrwxrwxrwx 1 root root     12 Feb 29 21:32 /usr/lib/libs3.so.2 -> libs3.so.2.0
-rw-r--r-- 1 root root  70464 Feb 29 21:32 /usr/lib/libs3.so.2.0

把路径添加到libc.conf:  echo "/usr/lib" >> /etc/ld.so.conf.d/libc.conf

你可能感兴趣的:(warning: libssl.so.1.0.0, needed by ……lib/libcurl.so, not found (try using -rpath or -rpath-link))