I have downloaded and compiled the latest version of libssl, the result of which is located at /usr/local/ssl. I want to compile libssh2 using the files in this folder, and to do that I've set the switch --with-libssl-prefix=/usr/local/ssl.

After performing ./configure --with-libssl-prefix=/usr/local/ssl and make, the resulting libssh2.so, according to the output of ldd, depends on the libssl found in the /usr/lib64, which is exactly what I don't want.

What can I do to force libssh2 to be compiled with the libssl I have in /usr/local/ssl?


If you compiled and installed libssl into the default /usr/local path, there is a /usr/local/ssl, but the lib is not in there; it's just directories like certs and misc -- stuff that other things would probably put in a share directory (e.g. /usr/local/share/ssl).

The actual library is installed in a normal place, /usr/local/lib. Presuming you've already run ldconfig and that path is in a file in /etc/ld.so.conf.d, you should be able to then do:

ldconfig -p | grep ssl

And all the => paths should be into /usr/local/lib. If so, you can use:


No ssl or lib, etc. It should now be found properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.