OpenSSL installation and programming process in VC Environment
SSL is the Secure Sockets Layer, which is a Secure socket protocol. For details, see the introduction in the link.
Some mak files need to be generated during the configuration process. These generated codes are generated using perl scripts. Therefore, an ActivePerl
ActivePerl: http://www.activestate.com/activeperl/
Openss: http://www.openssl.org/(this article uses openssl-1.0.0-beta5)
Reference
Openssl
Directory
Install. win32
Instructions for installation:
1
And enter the decompressed directory.
> Cd C :/
Openssl-1.0.0-beta5
2
, Run
Configure
.
> Perl Configure VC-WIN32
If it fails, an obvious prompt is displayed.
3
, Create
Makefile
File.
> MS/do_ms
This method is recommended. The other two methods are recommended.
If used, make sure that the local machine has a compiler.
: MS/do_masm
(Default
VC
Built-in compiler; you can also download and install it on your own)
: MS/do_nasm
(Download it by yourself)
4
, Configuration
VC
Environment variable.
> Cd C:/program files/Microsoft Visual Studio/vc98/bin
> Vcvars32.bat
5
Compile the dynamic link library.
> Cd C:/openssl-0.9.8k
> Nmake-f ms/NTDLL. Mak
If the compilation is successful, the final output is
Out32dll
Directory: including executable files, two
DLL
(
Ssleay32.lib, libeay32.lib
) And two
Lib
File (
Ssleay32.dll, libeay32.dll
).
6
, Is
VC
Add the header file and static link library path.
Tools
À
Options
À
Directores
, In
Include files
Add
C:/openssl-0.9.8k/inc32
Directory; in
Libray files
Add
C:/openssl-0.9.8k/out32dll
.
7
, Write
OpenSSL
Program, see
C:/openssl-0.9.8k/demos
(
1
) Contains the corresponding header file.
# Include
<Openssl /***.
H
>
(2)
Add static Link Library
# Pragma
Comment
(Lib,
"Libeay32.lib"
)
# Pragma
Comment
(Lib,
"Ssleay32.lib"
)
Or
Project
À
Settings
À
Link
À
Object/library modules
Enter
Libeay32.lib ssleay32.lib
.
(
3
) Dynamic Link Library ssleay32.dll, libeay32.dll
Copy
C:/WINDOWS/system32
Or
Debug
Directory to ensure that the dynamic link library is in the correct path.