Compile OpenSSL in a VC Environment

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.