【问题标题】:How to ./configure -enable-openssl for libircclient?如何为 libircclient 配置 -enable-openssl?
【发布时间】:2016-03-06 16:41:28
【问题描述】:

我正在尝试使用 OpenSSL 配置 libircclient,但失败了。使用 MinGW msys:

X@X-PC /c/deps/libircclient
$ ./configure -enable-openssl
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
.......................etc etc
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: OpenSSL not found

我也添加了这些行,但失败了:

CPPFLAGS="-I/c/deps/openssl-1.0.1l/include
LDFLAGS="-L/c/deps/openssl-1.0.1l

结果是:

checking For MinGW32... no
checking for CRYPTO_new_ex_data in -lcrypto... yes
checking for SSL_library_init in -lssl... no
configure: error: OpenSSL not found

所以-lcrypto 可以,但是-lssl...不行

什么是问题和解决方案?


从源代码构建的 OpenSSL 使用:

cd /c/deps/
tar xvfz openssl-1.0.1l.tar.gz
cd openssl-1.0.1l
./Configure no-zlib no-shared no-dso no-krb5 no-camellia no-capieng no-cast no-cms \
  no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2 no-mdc2 no-rc5 \
  no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool \
  no-rc2 no-rc4 no-ssl2 no-ssl3 mingw64
make

【问题讨论】:

  • CPPFLAGS 用于 C 预处理器。请改用CFLAGS 和/或CXXFLAGS
  • 您没有将 --openssldir 与 OpenSSL 的 Configure 一起使用。 OpenSSL 究竟安装在 MinGW 的什么位置?或者,你输入make后做了什么?另见How to build OpenSSL with MinGW in WIndows?

标签: openssl mingw msys


【解决方案1】:

你自己编译过 OpenSSL 吗?

如果有,我会仔细检查 OpenSSL 是否已正确编译,并确保 lib 位于 openssl 根目录中(例如,不是 /c/deps/openssl-1.0.1l/lib)。

【讨论】:

  • 我已经从源代码构建了 openssl,我在 openssl 目录中没有 /lib 目录。我已经在 OP 上添加了 openssl 编译行,请看一下
  • 我会尝试删除 ./configure 中的所有这些 no-something 选项,看起来您正在禁用某些 SSL 库,但我不确定哪个实际上创建了 SSL 库本身。
  • 我已经使用相同的 openssl 配置编译了许多需要 -lcrypto 和 -lssl 的程序,没有任何问题。生病挖掘更多,希望有一个新的答案。 PS:我在 openssl 根目录中有 libcrypto.a 和 libssl.a
  • 现在这很奇怪,人们会假设如果它找到了一个,它就能找到另一个。我唯一能想到的是它会检查 SSL_library_init,也许这不在您的特定版本的 libssl 中。您能否尝试在该目录中运行 nm libssl.a 并查看 SSL_library_init 是否在符号列表中?
  • 是的,我得到了2500多行,在ssl_algs.o:下找到了SSL_library_init,我编译了一个旧的openssl并测试并分享了结果。
猜你喜欢
  • 2015-03-21
  • 1970-01-01
  • 2013-12-10
  • 2013-01-11
  • 2019-04-27
  • 1970-01-01
  • 1970-01-01
  • 2018-12-10
  • 2013-10-23
相关资源
最近更新 更多