场景
VS2015编译openssl-1.1.1-pre1ide
工具
nasm-2.14rc0-installer-x64.exe
ActivePerl-5.24.3.2404-MSWin32-x64-404865.exe
openssl-1.1.1-pre1.tar.gz工具
环境变量
C:\Program Files\NASM(添加汇编器路径)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin(VS2015编译路径)debug
操做
1)perl Configure VC-WIN32 [no-shared] [no-asm] [no-tests] [--debug] --prefix=d:\openssllib
VC-WIN32:可根据须要修改成64位等,no-shared为编译静态库,不加此项默认编译出的是动态库;no-tests为不须要tests功能,若是只须要openssl的库能够加上此项,不然可能会出不少错误致使编译不过;--debug为编译debug版,不加此项默认编译出的是release版。
2)nmake,编译经过后再nmake install就安装到--prefix=指定的目录了。
3)若是要编译多个版本(release,debug),最好先nmake clean下,再重复第3步骤。
注意:
1.VS工程的运行时库(Runtime Library)选择应与编译出的openssl库匹配,尤为动态库,不然可能编译不过
2.须要使用静态库的时候,若是编译不过,出现LNK2019等错误的时候,你可能还须要添加ws2_32.lib,crypt32.lib库。
3.NASM汇编器没有安装出现以下错误
C:\Users\admin\Downloads\openssl-1.1.1-pre1>perl Configure VC-WIN32
Using implicit seed configuration
Configuring OpenSSL version 1.1.1-pre1 (0x10101001L) for VC-WIN32
NASM not found - please read INSTALL and NOTES.WIN for further details
4It looks like you don't have either nmake.exe or dmake.exe on your PATH错误解决方案
It looks like you don't have either nmake.exe or dmake.exe on your PATH,
so you will not be able to execute the commands from a Makefile. You can
install dmake.exe with the Perl Package Manager by running:
ppm install dmake
解决:执行ppm install dmake,安装dmake。
说明:ppm是perl图形化包管理工具,dmake是同GNU Make相似的工具,支持跨平台
当前安装VS2015,搜索到nmake.exe,而后执行vcvarsall.bat,而且添加了VS的nmake路径到环境变量仍是有问题ssl