Libssh2 compilation error (configure error: cannot find OpenSSL or libgcrypt) Solution

Source: Internet
Author: User

If it is executed according to the standard configure:
. /Configure -- prefix =/data/users/mooon/third-party/libssh2 -- With-OpenSSL -- With-libssl-Prefix =/data/users/mooon/third-party/OpenSSL -- without-libgcrypt-Prefix

If the following error is returned:
Checking for shared library run path origin... Done
Checking for libssl... no
Checking for libgcrypt... no
Configure: Error: cannot find OpenSSL or libgcrypt,
Try -- With-libssl-Prefix = path or -- With-libgcrypt-Prefix = path

Please change it to the following:
./Configure -- prefix =/data/users/mooon/third-party/libssh2Cppflags= "-I/data/users/mooon/third-party/OpenSSL/include"Ldflags= "-L/data/users/mooon/third-party/OpenSSL/lib"

Why can the above methods solve the problem:

The principle is very simple, that is, to meet its needs. It is reported that OpenSSL cannot be found. Since -- With-libssl-Prefix does not take effect, it is directly specified through cppflags and ldflags, when ". /configure -- Help "to see the supported. You can even view the config. log file to learn about this information. In the future, you can use a similar method to solve similar problems, and the software won't work hard.


One important reason for this error is that OpenSSL is not installed in the standard directory. If OpenSSL is installed with A./configure without -- prefix, this problem may not occur.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.