Qt5, Windows 7, MSVC 2010, and 64 bit compilation

Basically following this blog. However not every step works for me so some steps are modified. Local downloads of python, ICU, Perl64, ruby, openSSL and Windows SDK are offered.

1-Download and install python
link

2-download and unzib ICU to c:icu
link

3-Download and install Perl64
link

4-Download and install ruby
link

5-Download and install OpenSSL
link

6-Download and install Windows SDK
link

7-Download and unzib QT5 source to a any directory, ex D:Qt64Qt5.1.1qtbase
(This path will be added to path variable in your environment variables later)
link

8-Download jom
link

9-Make a new environment variable
Name: QMAKESPEC
Value: win32-msvc2010

10-Make another environment variable
Name: QTDIR
Value: D:Qt64Qt5.1.1qtbase

11-Make sure you have these vars in your path
C:icubin64;C:Ruby193bin;C:Python33;C:Perl64sitebin;C:Perl64bin;QTDIRbin;D:Qt64Qt5.1.1gnuwin32bin;

12-After installing everything, start “Visual Studio x64 Win64 Command Prompt” from start menu

13-Enter these commands

set CL=/MP
cd D:Qt64Qt5.1.1qtbase

configure -debug-and-release -confirm-license -opensource -mp -qt-sql-sqlite -opengl desktop -platform win32-msvc2010 -openssl -L C:/OpenSSL-Win64/lib -I C:/OpenSSL-Win64/include

This configure command is different from the qt blog.

14-Now the configuration process starts, it will take around a minute to configure qt

15-After the configuration finishes just type nmake or jom.exe -j6. I have 8 threads so I used 6

16-The compiling should start, this took 3.5~4 hours on my Intel i7 2670.

17-type nmake doc or jom.exe -j6 doc to generate the documentation. After building, you should find *qch files under D:Qt64Qt5.1.1qtbasedoc

If you need to compile QtCreator X64 you need to

1-Download and unzib QtCreator source code to a directory ex D:Qt64qt-creator-5.1.1
link

2-Start “Visual Studio x64 Win64 Command Prompt” from start menu

3-Enter these commands

set CL=/MP
cd D:Qt64qt-creator-5.1.1

D:Qt64Qt5.1.1qtbasebinqmake.exe -r -spec win32-msvc2010 "CONFIG+=release" "QT_PRIVATE_HEADERS=D:Qt64Qt5.1.1qtbaselib" .qtcreator.pro

The above command is different from the qt blog.

4-After the processing finishes just type nmake or jom.exe -j6 and PRESS ENTER
this will take around 1 hour to complete.

qtcreator_info

After Qtcreator built, changing a user local path, restart, or installation of any qt plugin may make qtcreator not working. For example, I got messages like “QT5core.dll” not found, even though I can use Qtcreator after building. So

5- copy all *.dll from D:Qt64Qt5.1.1qtbasebin to D:Qt64qt-creator-5.1.1bin

if you want to compile mysqldriver plugin

1-Download and install MySql Server
link

2-Go to D:Qt64Qt5.1.1qtbasesrcpluginssqldriversmysql and open the file “mysql.pro”
in notepad

3-Add the following lines at the end of the file
INCLUDEPATH += “C:Program FilesMySQLMySQL Server 5.5include”
LIBS += -L“C:Program FilesMySQLMySQL Server 5.5lib”

4- save and close the file

5-Start “Visual Studio x64 Win64 Command Prompt” from start menu

6-Enter these commands
set CL=/MP PRESS ENTER
cd D:Qt64Qt5.1.1qtbasesrcpluginssqldriversmysql PRESS ENTER

D:Qt64Qt5.1.1qtbasebinqmake.exe D:Qt64Qt5.1.1qtbasesrcpluginssqldriversmysqlmysql.pro

PRESS ENTER

7- Now just type nmake PRESS ENTER
The mysql driver plugin should now be compiled

Leave a Reply

Your email address will not be published. Required fields are marked *