手动编译 OpenSSL (Windows)

1. Download openssl

https://www.openssl.org/source/

2. Download & install Perl

https://www.perl.org/get.html

3. Set vs build env(eg: vs2019 64bit)

execute  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat

4. Configure

cd openssl source folder

perl Configure debug-VC-WIN32 no-asm --prefix="c:\openssl"

--prefix point to installation path

release version use VC-WIN32

5.Generate .mak file

ms\do_ms.bat or ms\do_ms64a.bat

7. build and install static/dynamic library

nmake -f ms\nt.mak

nmake -f ms\nt.mak install

nmake -f ms\ntdll.mak

nmake -f ms\ntdll.mak install

8. Possible error when compile

error LNK2001: unresolved external symbol OPENSSL_rdtsc

Fix:  OPENSSL_rdtsc is only relevant on some platforms, and isn't present on others which is why this problem occurs. Perhaps later Visual Studio versions are more tolerant of this? Removing the entry from util/libeay.num is fine as a workaround for now, and won't cause any adverse impacts.

fatal error LNK1181: cannot open input file 'out32dll\libeay32.lib'

Fix: copy relative .lib file in prefix installation file to out32dll folder

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容