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...
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
2-download and unzib ICU to c:\icu
3-Download and install Perl64
4-Download and install ruby
5-Download and install OpenSSL
6-Download and install Windows SDK
7-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)
8-Make a new environment variable
9-Make another environment variable
10-Make sure you have these vars in your path
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 ENTER
configure -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
13-Press y to accept the license agreement and PRESS ENTER
14-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
2-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 ENTER
C:\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"
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
2-Go to C:\QT\X64\5.0.0\msvc2010\qtbase\src\plugins\sqldrivers\mysql and open the file "mysql.pro"
3-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 ENTER
7- Now just type nmake PRESS ENTER
The mysql driver plugin should now be compiled
hope that helps.
my internet was slow so I edited the post many time, sorry
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?
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?
[maitai] <-- unfortunately I have no idea what your problem might be, sorry
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...