zoukankan      html  css  js  c++  java
  • libssh2编译错误(configure error: cannot find OpenSSL or Libgcrypt)解决方法

    如果按标准的configure执行:
    ./configure --prefix=/data/users/mooon/third-party/libssh2 --with-openssl --with-libssl-prefix=/data/users/mooon/third-party/openssl --without-libgcrypt-prefix

    得到如下错误时:
    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

    请改成如下:
    ./configure --prefix=/data/users/mooon/third-party/libssh2 CPPFLAGS="-I/data/users/mooon/third-party/openssl/include"LDFLAGS="-L/data/users/mooon/third-party/openssl/lib"

    上述方法为何可以解决问题:

    道理非常简单,就是满足它的需求,报的是找不到OpenSSL,既然--with-libssl-prefix没生效,那么就直接通过CPPFLAGS和LDFLAGS来指定,当执行“./configure --help”可以看到这个支持的。甚至可以通过查看config.log日志文件来了解这方面的信息,以后遇到类似的问题,都可以采取类似的办法,软的不行来硬的。


    ​遇到这个错误的一个重要原因是:OpenSSL没有安装在标准的目录下,如果以./configure不带--prefix安装OpenSSL,则可能不会出现这个问题。

  • 相关阅读:
    大端小端
    浅谈协程
    boost总结之any
    boost总结之variant
    STL总结之functor
    zabbix设置多个收件人
    zabbix设置发送消息的时间
    zabbix利用微信报警
    Windos无法验证文件数组签名
    zabbix基础安装
  • 原文地址:https://www.cnblogs.com/aquester/p/9891728.html
Copyright © 2011-2022 走看看