windows10的vs2019编译openssl静态库备忘
1、下载安装openssl源码
2、官网下载安装activeperl或Strawberry Perl。
官网下载慢,网盘找找。使用中activeperl有些异常提示、缺模块,最后使用了Strawberry Perl。
3、安装nasm。
powershell使用choco install nasm -y 即可。
powershell使用cd命令打开当前源码目录。使用perl Configure VC-WIN32 no-shared no-module no-tests no-legacy --prefix=C:\OpenSSL-static-vs2019 --openssldir=C:\OpenSSL-static-vs2019\ssl编译x86版本静态库,使用perl Configure VC-WIN64A no-shared no-module no-tests no-legacy --prefix=C:\OpenSSL-static-vs2019 --openssldir=C:\OpenSSL-static-vs2019\ssl编译x64版本静态库。
4、打开Native Tools Command Prompt for VS 2019开始编译。x64版本使用x64 Native Tools Command Prompt for VS 2019,x86版本使用x86 Native Tools Command Prompt for VS 2019。使用命令nasm系统开始编译,编译完成后使用nasm install 生成的库和头文件等内容拷贝到C:\OpenSSL-static-vs2019。