Windows平台OpenSSL编译方法(64位编译器)

1 下载OpenSSL源代码包

https://www.openssl.org/

本文下载版本为: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

地址:http://www.nasm.us/

在这里插入图片描述

c.OpenSSL代码

https://www.openssl.org/

设置系统环境变量

在这里插入图片描述

安装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'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值