Windows平台OpenSSL编译方法(64位编译器)
1 下载OpenSSL源代码包
本文下载版本为:openssl-1.1.1l.tar.gz
注意:版本不同,编译方法有区别。
http://slproweb.com/products/Win32OpenSSL.html
https://www.openssl.net.cn/docs/141.html
2 编译环境(64位编译环境)
a. 安装ActivePerl (Qt安装后自带Perl工具链)
地址:http://www.activestate.com/activeperl/downloads
b. 安装nasm
c.OpenSSL代码
设置系统环境变量
安装VS2017开发环境
nmake 不能用的解决方法
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
关于windows系统编译openssl遇到的ms\do_ms不是内部或外部命令的解决方法
https://blog.csdn.net/qq_33204646/article/details/70624170
这之类的命令,我在编译时输入这些的命令都是提示找不到这些命令,按照网上的说法也重新去安装了一些编译器,结果是统统无效。折腾了快一个下午,无可奈何跑到外网去找,才发现原来从openssl 1.1.0版本以后就不再有ms\do_*.bat这样的文件,而是直接使用nmake命令就行了,原文贴上来:
OpenSSL配置和编译
on Windows (only pick one of the targets for configuration):
$ perl Configure VC-WIN64A
$ nmake
$ nmake test
$ nmake install
Note that in order to perform the install step above you need to have
appropriate permissions to write to the installation directory.
If any of these steps fails, see section Installation in Detail below.
This will build and install OpenSSL in the default location, which is:
Unix: normal installation directories under /usr/local
OpenVMS: SYS$COMMON:[OPENSSL]
Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL
The installation directory should be appropriately protected to ensure
unprivileged users cannot make changes to OpenSSL binaries or files, or install
engines. If you already have a pre-installed version of OpenSSL as part of
your Operating System it is recommended that you do not overwrite the system
version and instead install to somewhere else.
最后执行nmake install
后来翻了一下openssl的install文档,才发现里面都有写
win32: LIBS += -L$$PWD/'../../../../../Program Files/OpenSSL/lib/' -llibcrypto -llibssl
INCLUDEPATH += $$PWD/'../../../../../Program Files/OpenSSL/include'
DEPENDPATH += $$PWD/'../../../../../Program Files/OpenSSL/include'