openssl编译

关于windows下,openssl编译

环境准备
  1. 安装 perl:https://djvniu.jb51.net/200906/tools/ActivePerl5_64.rar

  2. 安装nasm:https://www.nasm.us/pub/nasm/releasebuilds/2.13.01/win64/nasm-2.13.01-installer-x64.exe

  3. 下载opensll源码:https://openssl-library.org/source/old/3.0/index.html

  4. 加入系统PATH变量

  5. 验证

    #验证perl
    perl --version
    #验证nasm
    nasm --version

编译

打开vs 工具=>命令行=>开发者命令提示 (如果配置环境变量之前vs已打开,则关闭vs之后重新打开),不要使用cmd,会提示找不到nmake

cpp 复制代码
#默认Release
#--prefix 需要绝对路径
perl configure VC-WIN64A --prefix=F:\project\openssl-3.0.14\build\vs2019\release\
nmake 
nmake test
nmake install

configuer option:default Release /MD

cpp 复制代码
- `perl Configure VC-WIN32`     if you want 32-bit OpenSSL or
- `perl Configure VC-WIN64A`    if you want 64-bit OpenSSL or
- `perl Configure VC-WIN64-ARM` if you want Windows on Arm (win-arm64)
Debug or Release
cpp 复制代码
#Release
`perl Configure VC-WIN64A`

#debug recommand
`perl Configure VC-WIN64A --debug`
or
`perl Configure debug-VC-WIN64A`
静态库
cpp 复制代码
#如果指定no-shared则默认MT,否则默认MD
#lib & MD
perl Configure VC-WIN32 -static 

#lib & MT
perl Configure VC-WIN32 -static no-shared
/MD /MT
cpp 复制代码
#MT
perl configure VC-WIN64A -static no-shared /MTd --debug
perl configure VC-WIN64A -static no-shared /MT 
#MD
perl configure VC-WIN64A -static /MDd --debug
perl configure VC-WIN64A -static /MD 
demo
cpp 复制代码
    perl configure VC-WIN64A -static no-shared /MTd --prefix=F:\project\openssl-3.0.14\build\vs2019static\debug\ --debug
DOC
cpp 复制代码
查看源文件目录下:NOTES-*.md INSTALL.md
编译 1.x.x版本

整体和上面没有区别,当arch不匹配的时候会报错。

1.编译x86,以管理员身份打开x86 Native Tools Command Prompt for VS 2019

2.编译x64,以管理员身份打开x64 Native Tools Command Prompt for VS 2019

相关推荐
阿白的白日梦4 天前
winget基础管理---更新/修改源为国内源
windows
埃博拉酱8 天前
VS Code Remote SSH 连接 Windows 服务器卡在"下载 VS Code 服务器":prcdn DNS 解析失败的诊断与 BITS 断点续传
windows·ssh·visual studio code
唐宋元明清21889 天前
.NET 本地Db数据库-技术方案选型
windows·c#
加号39 天前
windows系统下mysql多源数据库同步部署
数据库·windows·mysql
tryCbest9 天前
Windows环境下配置pip镜像源
windows·pip
呉師傅9 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
百事牛科技9 天前
保护文档安全:PDF限制功能详解与实操
windows·pdf
一个人旅程~9 天前
如何用命令行把win10/win11设置为长期暂停更新?
linux·windows·经验分享·电脑
一个假的前端男9 天前
[特殊字符] Flutter 安装完整指南 Windows—— 2026最新版
windows·flutter
倚肆9 天前
在 Windows Docker 中安装并配置 Nginx (映射 Windows 端口与路径)
windows·nginx·docker