开源的坑一堆堆
编译环境:windows10 + Visual Studio 2015 + strawberry perl 5.32.1.1-64bit + openssl-1.1.1k,其中最重要的就是strawberry perl。openssl推荐的windows下的perl是ActivePerl,网上一搜也都是千篇一律的使用ActivePerl,结果忙活了半天,各种查各种试,全都是这种错误:
Configuring OpenSSL version 1.1.1k (0x101010bfL) for VC-WIN32
Using os-specific seed configuration
Can't locate Win32/Console.pm in @INC (you may need to install the Win32::Console module) (@INC contains: C:/openssl-1.1.1k/util/perl D:/application/perl64/site/lib D:/application/perl64/lib) at D:/application/perl64/site/lib/ActivePerl/Config.pm line 400.
Compilation failed in require at D:/youyb/application/perl64/site/lib/ExtUtils/MakeMaker.pm line 10.
BEGIN failed--compilation aborted at D:/youyb/application/perl64/site/lib/ExtUtils/MakeMaker.pm line 10.
Compilation failed in require at D:/youyb/application/perl64/site/lib/IPC/Cmd.pm line 235.
最后在stackoverflow上找了一个帖子,帖子里说有人用strawberry perl成功了,自己一试果然如此。至于strawberry perl和ActivePerl啥区别网上说的挺细,这里就不说了。
编译步骤:
1,下载strawberry perl https://strawberryperl.com/releases.html,可以选择ZIP edition版,解压即可用,免安装。
2,添加path环境变量,如:c:\strawberry-perl-5.32.1.1-64bit\perl\bin,命令行perl -v看版本
3,下载openssl https://www.openssl.org/source/,解压,如:c:\openssl-1.1.1k
4,打开Developer Command Prompt for VS2015命令行工具,cd进入c:\openssl-1.1.1k
5,perl Configure VC-WIN32 no-asm --prefix=d:\openssl (可选项:VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE,--prefix是最终拷贝的目录;添加no-shared参数可生成静态库)
6,nmake
7,nmake test
8,nmake install
最后生成的目录下文件如下: