Win32下OpenSSL的安装方法

时间:2021-10-11 13:12:22

环境: VC++, ActivePerl

1. 下载openssl源代码: http://www.openssl.org/

2. 配置

 D:/openssl-0.9.8a>perl Configure VC-WIN32
D:/openssl-0.9.8a>ms/do_ms.bat

运行时会出现找不到%OSVERSION%环境变量的错误,不必理会。

3. 编译

(ntdll.mak编译成动态dll。如需要静态dll则使用nt.mak)

 D:/openssl-0.9.8a>"C:/Program Files/Microsoft Visual Studio/VC98/Bin/VCVARS32.BAT"
Setting environment for using Microsoft Visual C++ tools.
D:/openssl-0.9.8a>nmake -f ms/ntdll.mak

4. 测试

 D:/openssl-0.9.8a>cd out32dll
D:/openssl-0.9.8a/out32dll>../ms/test

5. 安装

 D:/openssl-0.9.8a>md c:/lib/openssl
D:/openssl-0.9.8a>md c:/lib/openssl/bin
D:/openssl-0.9.8a>md c:/lib/openssl/lib
D:/openssl-0.9.8a>md c:/lib/openssl/include
D:/openssl-0.9.8a>md c:/lib/openssl/include/openssl
D:/openssl-0.9.8a>copy /b inc32/openssl/* c:/lib/openssl/lib
D:/openssl-0.9.8a>copy /b out32dll/ssleay32.lib c:/lib/openssl/lib
D:/openssl-0.9.8a>copy /b out32dll/libeay32.lib c:/lib/openssl/lib
D:/openssl-0.9.8a>copy /b out32dll/ssleay32.dll c:/lib/openssl/bin
D:/openssl-0.9.8a>copy /b out32dll/libeay32.dll c:/lib/openssl/bin
D:/openssl-0.9.8a>copy /b out32dll/openssl.exe c:/lib/openssl/bin
D:/openssl-0.9.8a>copy README c:/lib/openssl
D:/openssl-0.9.8a>copy LICENSE c:/lib/openssl