FXSend/MobsetHttp/Openssl编译方法.txt
2025-02-28 17:05:50 +08:00

37 lines
1.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1.安装Perl并添加到环境变量 (http://strawberryperl.com/)
2.安装NASM并添加到环境变量 (https://www.nasm.us/)
3.解压openssl源码到指定目录
4.进入VS2017自带的命令行界面注意区分版本 (64位与32位
本文进入的是x64 Native Tools Command Prompt for VS2017
5.进入openssl解压目录E:\mylib\openssl-1.1.2l
根据需要运行:
perl Configure VC-WIN64A no-shared -prefix=D:\OpenSSL64
perl Configure VC-WIN32 -prefix=D:\OpenSSL
perl Configure VC-WIN64A no-asm prefix=D:\OpenSSL64
perl Configure VC-WIN32 no-asm -prefix=D:\OpenSSL
进行相关的配置
注意prefix指定安装目录VC-WIN64A安装平台
5.编译动态库和静态库
运行 nmake
6.测试编译库
nmake test
7.发布
nmake install
注: 清除上次动态库编译以便重新编译nmake clean
7.安装库
运行 nmake install 进行安装动态库
在E:\mylib\openssl文件目录下生成bin/include/lib/ssl四个文件目录。
运行 nmake -f ms\nt.mak install 进行安装静态库
然后将配置修改成perl Configure VC-WIN32 no-asm no-shared --prefix="c:\download\opensslh110\build_release32"? ,64位修改成 perl Configure VC-WIN64A no-asm no-shared --prefix="c:\download\opensslh110\build_release64" ,这样就可以通过编译了,如果在自己的项目里使用编译出来的静态库失败,那么请加上类似crypt32.lib等依赖库,一般就可以解决,但是注意,加了no-shared以后,最后的nmake install 命令可能失败,需要手动拷贝了
当出现与目标计算机不符时X64 与 X86一定要使用相应版本的cmd工具打开编译再不行就重新解压干净的版本重新编译。
直接下载编译好的版本:
https://www.npcglib.org/~stathis/blog/precompiled-openssl/