目录
- [1. 源码下载](#1. 源码下载)
- [2. vs2022编译](#2. vs2022编译)
1. 源码下载
2. vs2022编译
(1) 将"VS2022安装目录VC\Auxiliary\Build\"设置为PATH环境变量,启动cmd命令行(一定要先设置环境变量)。
(2)在cmd下进入VS2013安装目录vs2022\VC\Auxiliary\Build,运行vcvars64.bat文件(如果不执行这一步,后面编译openssl时会报错)
(3)进入openssl 源码路径,依次执行:
perl configure VC-WIN64A no-asm ,VC-WIN64A表示编译release版本,前面加debug-VC-WIN64A表示编译debug版本,no-asm表示NASM非必安装项。
nmake:编译
nmake test:执行自带的例子,如果通过最终会有一个pass (可以不用执行)
nmake install:生成编译结果
编译后在openssl源代码根目录下生成libcrypto_static.lib和libssl_static.lib,在include目录下有头文件。
原文链接:https://blog.csdn.net/kingsoft188/article/details/124176660
遇见的问题:
执行perl configure VC-WIN64A no-asm时,出现预先错误
Can't locate Win32/Console.pm in @INC (you may need to install the Win32::Console module) (@INC contains: C:\Perl64\site\lib C:\Perl64\lib) at C:\Perl64\lib/ActivePerl/Config.pm line 400.
解决办法:
修改C:\Perl64\site\lib\ActivePerl\Config.pm,大约在400行左右:
perl
my $console;
sub _warn {
# my($msg) = @_;
# unless (-t STDOUT) {
# print "\n$msg\n";
# return;
# }
# require Win32::Console;
# unless ($console) {
# $console = Win32::Console->new(Win32::Console::STD_OUTPUT_HANDLE());
# }
# my($col,undef) = $console->Size;
# print "\n";
# my $attr = $console->Attr;
# $console->Attr($Win32::Console::FG_RED | $Win32::Console::BG_WHITE);
# for (split(/\n/, "$msg")) {
# $_ .= " " while length() < $col-1;
# print "$_\n";
# }
# $console->Attr($attr);
# print "\n";
}
原文链接:https://blog.csdn.net/zhangzq86/article/details/105100942