Compile and install openssl under Windows

Recently, the project needs to use soap programming. The local test is ok, but accessing the remote host prompts that tcp_connect() fails. The Internet says soap_ssl_init(); soap_ssl_client_context(); but the compilation reports an error, saying that various errors are temporarily attributed to openssl. So first build the openssl environment.

My system: window8 64

Development environment: VS2008

Preparation tools: perl, openssl, nasm, VC

perl: Perl has ActiveStatePerl and Strawberry Perl compilers on the Window platform. I use Strawberry Perl. http://strawberryperl.com/

openssl: Do not use version 1.1.1, the latest version at the time of this post was 1.1.1. Version 1.0.2 can be downloaded. http://www.openssl.org recommends choosing version 1.0.2 on the download page

nasm: nasm may be used in the process of compiling openssl, otherwise it will prompt NASM not found. https://www.nasm.us/

VC: Choose VC6 or above. I have used VS2008, so I won't go into details.

1. Install perl, nasm

Download perl, nasm, the installation process is very simple, just keep on next

2. Unzip openssl

Download openssl, unzip, the path is arbitrary, there is a general directory in the compressed package, don't be afraid to unzip the scattered files

Do not choose openssl in 1.1.1

Do not choose openssl in 1.1.1

Do not choose openssl in 1.1.1

The important things are said three times, otherwise even if the process goes well, the result will not be satisfactory. something is missing

3. Open the command line

cd to the decompression directory of openssl, which is where there are directories such as apps, bugs, certs, etc.

a. Execute: perl Configure VC-WIN32

If nasm is not installed, it may prompt NASM not found, so install nasm. and set environment variables.

b. Execute: ms\do_nasm.bat

c. Set the environment variables of VS2008 to execute nmake, which cannot be used by default. If it can be used, ignore this step

c:

cd C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin

vcvars32.bat

I am a VS2008 development environment, so the path is as above, other versions may have different paths

d. Execute: nmake -f ms\ntdll.mak -a

This is to generate static library + dynamic library

If you only need a static library, execute: nmake -f ms\nt.mak -a

It is said on the Internet that the execution of ms\do_ms.bat may give an error

tmp32dll\sha1-586.asm(1427) : error A2070:invalid instruction operands
tmp32dll\sha1-586.asm(1571) : error A2070:invalid instruction operands

The process is a bit long

4. There will be libeay.lib, libeay.dll, ssleay32.lib, ssleay32.dll and many other files in the out32dll directory, I only need libeay.lib, libeay.dll, ssleay32.lib, ssleay32.dll

There are many header files in the inc32\openssl directory. not include directory

5. If you need to install it, you can execute it

nmake test

nmake install

That is, the compilation and copying process is copied to the c:\Program Files(x86)\OpenSSL directory by default.


I don't care about extracting the files I need for the time being.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325591829&siteId=291194637