Good day...

Today's task is to build Qt 4.8.6 from source.

This is the first article describing my journey on this project and more will be published later.

It will be as brief as possible because I'm updating this blog as soon as each step was performed.

Let's start.

Assumed that you already have Visual Studio 2012 installed on your machine.

1) Download and install ActivePerl x64.

2) Get precompiled OpenSSL from https://www.npcglib.org/~stathis/blog/precompiled-openssl/.

3) Download openssl-1.1.0f-vs2012.7z.

4) Extract this file to C:\OpenSSL-1.1-0f-vs2012.

5) Download qt-everywhere-opensource-src-4.8.6.zip from Qt archive repository.

6) Extract this file to C:\Qt\4.8.6_x642012.

7) Add QTDIR=C:\Qt\4.8.6_x642012 to your environmental variable.

8) Add C:\Qt\4.8.6_x642012\bin and C:\OpenSSL-1.1.0f-VS2012\bin64 to your path.

9) Run "Open VS2012 x64 Native Tools Command Prompt"

10) cd to C:\Qt\4.8.6_x642012

11) Type in the following command:

configure -mp -prefix C:/Qt/4.8.6_x642012 -debug-and-release -shared -exceptions -stl -confirm-license -opensource -qt-zlib -qt-libjpeg -qt-libpng -qt-libmng -qt-libtiff -no-qt3support -no-webkit -I C:/OpenSSL-1.1.0f-VS2012/include64 -L C:/OpenSSL-1.1.0f-VS2012/lib64 -plugin-sql-mysql -I C:/Mysql-5.7.19-winx64/include -L C:/Mysql-5.7.19-winx64/lib -plugin-sql-psql -I C:/Postgresql-9.6.5-1-x64/include -L C:/Postgresql-9.6.5-1-x64/lib -plugin-sql-odbc

(Note: this is my preferred configuration. You can choose options that best fit your needs).

11.1) If you include these options:

-plugin-sql-psql -I C:/Postgresql-9.6.5-1-x64/include -L C:/Postgresql-9.6.5-1-x64/lib

You need to get PostgreSQL (postgresql-9.6.5-1-windows-x64-binaries.zip) prior to above configuration or otherwise remove these options.

Just in case you need to download PostgreSQL binaries, it can be found here: https://www.enterprisedb.com/postgresql-965-binaries-win64. Extract it to C:\Postgresql-9.6.5-1-x64 folder.

11.2) If you include these options:

-plugin-sql-mysql -I C:/Mysql-5.7.19-winx64/include -L C:/Mysql-5.7.19-winx64/lib

You need to get Mysql (mysql-5.7.19-winx64.zip) prior to above configuration or otherwise remove these options.

Download from https://dev.mysql.com/downloads/mysql/ to get this file. Extract to C:\Mysql-5.7.19-winx64 folder.

12) run nmake and wait.... wait.... wait for it..... done!

13) Check C:\Qt\4.8.6_x642012bin and C:\Qt\4.8.6_x642012lib folders to see DLLs and lib files are created.