Building Qt 4.8 x64 using VS2012 on Windows 10

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.

Revisiter - VB.NET strings

How many times you wish you can construct strings not using the " (quote) and + (plus).

In our day to day programming, we usually do stuff like:

Sub Query(table_name As String, idx As Integer)
  Dim sql As String = "SELECT * FROM " + table_name + "WHERE PKID=" + idx.ToString()
EndSub

Or maybe you can use "string.format" or StringBuilder

Dim sql As String = String.Format("SELECT * FROM {0} WHERE PKID={1}", table_name, idx)

Or

Dim sql As New StringBuilder
sql.Append("SELECT * FROM ").Append(table_name).Append(" WHERE PKID=").Append(idx.ToString())

As you can see, you can't get away from using the " and + sign. angry.jpeg

Fortunately, there is another way to write above code and you can only get in VB.NET, sorry C# guys...

Dim sql As String = <span>SELECT * FROM <%= table_name %> WHERE PKID=<%= idx.ToString() %>; <span>.Value

So elegant...

Try it out. Happy coding...

Introduction

Since my employer make it mandatory to use VB.NET as the development language for all of our projects, I shall be writing articles mostly related to VB.NET for my readers.

Having said that, I'll also occasionally write about other stuff related or not related to programming too. I've other interest like embedded device programming, operating systems kernel (windows and linux), design patterns, bayesian networks, machine learning and also other programming language like Go, Erlang and Clojure to name a few.

Thanks.

Please stay tune....

GitHub – stanleytktan

Stanley Tan

Malaysia

I'm a very "senior" software developer. tbc...