5.0, Windows 7 and MSVC 2010, and 64 bit compilation
-
I thought the 5.0 release was going to provide libraries that supported 64 bit compilation. When I start a new console project using QtCreator 2.6.1 with 5.0 installed, it only gives me a kit choice of "Desktop Qt 5.0.0 MSVC2010 32bit (SDK)". Do I have to build the 5.0 64 bit libraries from source using my msvc 2010 pro compiler (whine ...)? If this is the only way, where (and what) is the best guide for a newbie to follow to do this? Or is there a secret handshake to turn on 64 bit support?
And more whine - I've looked at the release notes, the wiki, and everywhere I can think of (including google) for info on building 64 bit Qt apps and can't find anything...
Paul
-
You will have to build a 64-bit version yourself but, as a self-professed newbie, you shouldn't bother unless you really need 64-bit memory space.
The source code bundle includes, as always, a file "README":http://qt.gitorious.org/qt/qt5/blobs/stable/README that tells you pre-requisites and the commands to type to build the Qt libraries. They do provide some links to more detail on the web site: http://qt-project.org/wiki/Building-Qt-5-from-Git The instructions rely on a level of familiarity with a command line and correct establishment of a build environment.
Once you have a set 64-bit libraries the Qt build system (qmake) will create 64-bit applications and libraries by default. There's no need for "info on building 64-bit apps": it's no different.
-
YOU NEED TO CHANGE ALL THE PATHS AND VARIABLES YOU WILL SEE IN THIS TUTORIAL TO POINT AT THE RIGHT PATHS ON YOUR MACHINE
1-Download and install python
http://www.python.org/ftp/python/3.3.0/python-3.3.0.amd64.msi2-download and unzib ICU to c:\icu
http://download.icu-project.org/files/icu4c/50.1.1/icu4c-50_1_1-Win64-msvc10.zip3-Download and install Perl64
http://www.activestate.com/activeperl/downloads/thank-you?dl=http://downloads.activestate.com/ActivePerl/releases/5.16.1.1601/ActivePerl-5.16.1.1601-MSWin32-x64-296175.msi4-Download and install ruby
http://rubyforge.org/frs/download.php/76642/rubyinstaller-1.9.3-p362.exe5-Download and install OpenSSL
http://slproweb.com/download/Win64OpenSSL-1_0_1c.exe6-Download and install Windows SDK
http://download.microsoft.com/download/F/1/0/F10113F5-B750-4969-A255-274341AC6BCE/GRMSDKX_EN_DVD.iso7-Download and unzib QT5 source to a any directory, ex C:\QT\X64\5.0.0\msvc2010\qtbase
(This path will be added to path variable in your environment variables later)
http://releases.qt-project.org/qt5/5.0.0/single/qt-everywhere-opensource-src-5.0.0.zip8-Make a new environment variable
Name: QMAKESPEC
Value: win32-msvc20109-Make another environment variable
Name: QTDIR
Value: C:\QT\X64\5.0.0\msvc2010\qtbase10-Make sure you have these vars in your path
C:\icu\bin64;C:\Ruby193\bin;C:\Python33;C:\Perl64\site\bin;C:\Perl64\bin;%QTDIR%\bin;C:\QT\X64\5.0.0\msvc2010\gnuwin32\bin;11-After installing everything, start "Visual Studio x64 Win64 Command Prompt" from start menu
12-Enter these commands
set CL=/MP PRESS ENTER
cd C:\QT\X64\5.0.0\msvc2010 PRESS ENTERconfigure -debug-and-release -opensource -developer-build -make libs -make tools -make examples -qt-sql-sqlite -opengl desktop -platform win32-msvc2010 -fully-process -openssl -L C:/OpenSSL-Win64/lib -I C:/OpenSSL-Win64/include -icu -L C:/icu/lib64 -I C:/icu/include
PRESS ENTER
13-Press y to accept the license agreement and PRESS ENTER14-Now the configuration process starts, it will take around a minute to configure qt
15-After the configuration finishes just type nmake PRESS ENTER
16-The compiling should start, this will take around two hours if you have a fast machine.
If you need to compile QtCreator X64 you need to
1-Download and unzib QtCreator source code to a directory ex C:\QT\X64\Tools\QtCreator
http://qt.gitorious.org/qt-creator/qt-creator/archive-tarball/master2-Start "Visual Studio x64 Win64 Command Prompt" from start menu
3-Enter these commands
set CL=/MP PRESS ENTER
cd C:\QT\X64\Tools\QtCreator PRESS ENTERC:\QT\X64\5.0.0\msvc2010\qtbase\bin\qmake.exe "QT_PRIVATE_HEADERS=C:\QT\X64\5.0.0\msvc2010\qtbase\lib" C:\QT\X64\Tools\QtCreator\qtcreator.pro -r -spec win32-msvc2010 "CONFIG+=release"
PRESS ENTER
4-After the processing finishes just type nmake and PRESS ENTER
this will take around 20 minutes to complete.if you want to compile mysqldriver plugin
1-Download and install MySql Server
http://dev.mysql.com/downloads/mirror.php?id=4110662-Go to C:\QT\X64\5.0.0\msvc2010\qtbase\src\plugins\sqldrivers\mysql and open the file "mysql.pro"
in notepad3-Add the following lines at the end of the file
INCLUDEPATH += "C:\Program Files\MySQL\MySQL Server 5.5\include"
LIBS += -L"C:\Program Files\MySQL\MySQL Server 5.5\lib"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 C:\QT\X64\5.0.0\msvc2010\qtbase\src\plugins\sqldrivers\mysql PRESS ENTERC:\QT\X64\5.0.0\msvc2010\qtbase\bin\qmake.exe C:\QT\X64\5.0.0\msvc2010\qtbase\src\plugins\sqldrivers\mysql\mysql.pro
PRESS ENTER
7- Now just type nmake PRESS ENTER
The mysql driver plugin should now be compiledhope that helps.
-
focus-gfx: thank you very much. I suspected that there was an elaborate procedure, and there sure is. I've printed out your email so I can have it next to me when I start later today.
Does anyone know if the "official" 64 bit libs are coming in the 5.1 (or soon thereafter) updates?
Paul
-
Hello,
I follow your steps and qt 5.0.1 (latest from git) compiled fine (Windows 7/64bits/mscv2010). My problem is that when I use that kit to compile, my application is around 7 times slower than when executed with the pre-compiled 32bits qt5 from Digia.
I have tried many other options for configure but no luck... Any idea of what I am doing wrong?
Thanks
-
I was using msvc2010/express and my problem came from that. I am now compiling with msvc2012/express and although I cannot compile my application in 64bits from inside qtCreator because msvc express edition does not contain the necessary scripts to initialize the 64bits compilator, I can anyhow build it from the 64bits msvc2012 command prompt. So it's ok with me since I can develop in 32 bits mode and only build in 64bits when deploying...