MinGW64 compile OpenSSL

introduction

 Written with Qt reptiles time, the lack of dynamic openssl library, try a few existing version is not right, then download the corresponding version of the source code from the official website to compile.

ready

surroundings

 My original works Qt environment is

  1. MinGW7.3.0-x64(gcc version 7.3.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project))
  2. Qt5.13.0

link

 I am here in the Qt libraries are supported openssl1.1.1.b, which belongs to an older version,
OpenSSL link

process

 Download the source code, you can extract.
 View the README,
install
 it will let you see NOTES file corresponding to the platform, my side is mingw compiled under the windows, to find NOTES.WIN,
find mingw compiled paragraphs,
mingwCompile
 my side is made out by the windows, so follow the instructions According to the first msys2 environment, msys2 , download the 64-bit version installed. msys2 is a simulation of Linux command-line development environment. msys2 in itself with the mingw, but the safe side, also mentioned in the paragraph above, preferably with mingw own development environment. So you need to put yourself under mingw environment into msys2 in. Here only need to create a Windows environment variable in your windows system variable MSYS2_PATH_TYPE = the inherit , msys2 will inherit the environment variables win system, to find the next win is already configured mingw tool (need to restart the shell window). msys2 command line, type gcc, no prompt can not find the file that success.
 msys2 in the home directory of your own can be seen as a free to use (it is not much inside the system or anything else), I suggest you put here openssl source projects move up / down home (of course other directories too).
home
 At this point, you can use the mingw under msys2 own (using the command name according to your mingw32-make.exe name may be), but this time using ./configure mingw64 openssl configuration compiled in the project directory, you will be prompted missing perl .

	/usr/bin/perl:bad interpreter:No such file or directory

 If you just downloaded from the Internet a perl, then msys2 refer to it, and then configure, you will find an error, a lack of dmake and so on. NOTES.PERL in the project directory in a note,
perl
strict requirements and perl build environment to match, so it simply, is to use msys2 package installation tools perl.
Enter pacman -S perlthe installation,
pacman
because the resources, the download process, some links may be too slow to download, it will be determined to be not connected, but download fails. This time try more than once, or even on the VPN test several times. Until the download is successfully installed.
installPerl
 After a successful installation, and then enter the make under openssl directory, naming the general will be successful (however, you may not have the tool path in line with unix-style, such as Program files, there is a space between this Program and file, such in the above named perl seems to be allowed, will be error, you need to change the path to prompt compliance with unix-style path, after handling this case, the general will compile correctly).
Note:
In general, we should pay attention to is,

  1. perl version to match the environment
  2. perl file involved (including tools used when calling) must be unix-style path

Finally, build the project according to the normal steps,. / Configure mingw64, make it a success.
compileSuccess

to sum up

 Be sure to compile the project in accordance with the document said, a lot of the pit.

Published 60 original articles · won praise 18 · views 20000 +

Guess you like

Origin blog.csdn.net/BadAyase/article/details/103921608