问题描述
尝试 ./configure libcurl 7.22.0 时出现以下错误
I get the following error when trying to ./configure libcurl 7.22.0
链接时可用的一个或多个库在运行时不可用.链接时使用的库:-lssh2 -lssl -lcrypto -lrt -lz
当我使用 --without-libssh2 进行 ./configure 时,它工作得很好.
When I ./configure with --without-libssh2 it works just fine.
我已采取的步骤:
apt-get install libssl-dev
apt-get install libssh-dev
cd /var
wget http://www.libssh2.org/download/libssh2-1.3.0.tar.gz
tar -zxvf libssh2-1.3.0.tar.gz
cd libssh2-1.3.0
./configure
make
make install
顺便说一句,SSL 支持工作正常.我一定是在 libssh 上做错了什么
SSL support works fine, by the way. I must have done something wrong with libssh
我也试过了:
./configure --with-libssh2
./configure --with-libssh2-path=/usr/local/lib
./configure --with-libssh2=/usr
./configure --with-libssh2=/usr/local/lib
但这并没有什么不同.我不知道还能尝试什么.
But it didn't make a difference. I don't know what else to try.
推荐答案
libssh-dev"包是完全不相关且不必要的,因为它是一个不同的库,libcurl 和 libssh2 都没有使用它.
The "libssh-dev" package is completely unrelated and unnecessary since it's a different library not used by libcurl nor libssh2.
您面临的问题可能是 libssh2 的make install"默认安装库/usr/local/lib 并且您没有编辑/etc/ld.so.conf 以从该目录加载库.编辑该文件并运行 ldconfig(以 root 身份执行这两个操作).或者,将 libssh2 安装到 ld.so 已经搜索到的另一个目录中.
The problem you face is probably that "make install" with libssh2 installs the library /usr/local/lib by default and you have not edited /etc/ld.so.conf to load libs from that directory. Edit the file and run ldconfig (both actions as root). Alternatively, install libssh2 into another directory that already is searched in by ld.so.
这篇关于带有 libssh2 的 libcurl - 链接时可用的一个或多个库在运行时不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!