【发布时间】: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?。