The OpenSSL library can be tricky to get going on Windows.
If you are brave, you can obtain the OpenSSL library source code directly from https://www.openssl.org/source/. You will, of course, need to build OpenSSL before it can be used. Building OpenSSL is not easy, but instructions are provided in the
NOTES.WIN files included with the OpenSSL source code.
An easier alternative is to install prebuilt OpenSSL binaries. You can find a list of prebuilt OpenSSL binaries from the OpenSSL wiki at https://wiki.openssl.org/index.php/Binaries. You will need to locate binaries that match your operating system and compiler. Installing them will be a matter of copying the relevant files to the MinGW
The following screenshot shows a binary OpenSSL distribution. The
lib folders should be copied over to
c:\mingw\ and merged with the existing folders, while
openssl.exe and the two DLL files need to be placed in
You can try building
openssl_version.c from Chapter 9, Loading Secure Web Pages with HTTPS and OpenSSL, to test that everything is installed correctly. It should look like the following: