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

相关推荐
qq_3692243315 天前
Windows全系通用!ntdll.dll文件丢失、报错、闪退问题的完整排查与修复教程
windows·dll·dll修复·dll丢失·dll错误
阿米亚波16 天前
【Windows】QEMU 启动 openEuler aarch64/arm64 架构系统 + 离线软件源
linux·windows·经验分享·笔记·架构·arm
caimouse16 天前
Reactos 第 10 章 网络操作 — 10.3.1 NIC驱动
网络·windows
初圣魔门首席弟子16 天前
Node.js 详细介绍(知识库版)
windows·qt·node.js·知识库
CHENG-JustDoIt16 天前
AI工具 | 爆火开源项目Odysseus AI 工作台:从项目介绍、部署情况及其使用等多方位分析指南(含详细步骤)
大数据·人工智能·windows·python·ai·开源·github
kingbal16 天前
Windows:flutter环境搭建
windows·flutter
未若君雅裁16 天前
Python 数据容器详解,list、tuple、str、set、dict 到底怎么选
windows·python·list
CodeKwang16 天前
Windows 环境 OCCT 8.0 编译构建及与 Qt6 项目集成
windows·qt·opencascade
我是伪码农16 天前
小兔鲜1-25
linux·服务器·windows
vx-Biye_Design16 天前
springboot安阳地区研学旅游服务小程序-计算机毕业设计源码12785
java·vue.js·windows·spring boot·tomcat·maven·mybatis