OpenSSL Windows编译

目录

  • [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

相关推荐
集成显卡4 小时前
windows 下使用 bat 批处理运行 Chrome 无头模式刷一波访问量
windows·程序员
路由侠内网穿透3 天前
本地部署 GPS 跟踪系统 Traccar 并实现外部访问
运维·服务器·网络·windows·tcp/ip
研华嵌入式3 天前
如何在高通跃龙QCS6490 Arm架构上使用Windows 11 IoT企业版?
arm开发·windows·嵌入式硬件
带娃的IT创业者3 天前
Windows 平台上基于 MCP 构建“文心一言+彩云天气”服务实战
人工智能·windows·文心一言·mcp
csdn_aspnet3 天前
Windows Node.js 安装及环境配置详细教程
windows·node.js
摇滚侠3 天前
java语言中,list<String>转成字符串,逗号分割;List<Integer>转字符串,逗号分割
java·windows·list
Source.Liu3 天前
【Pywinauto库】12.2 pywinauto.element_info 后端内部实施模块
windows·python·自动化
Source.Liu3 天前
【Pywinauto库】12.1 pywinauto.backend 后端内部实施模块
开发语言·windows·python·自动化
私人珍藏库3 天前
[Windows] FileOptimizer v17.1.0_一款文件批量压缩工具
windows·批量压缩
掘根3 天前
【CMake】List
windows·microsoft·list