
In recent years, Qt's cross-platform library has received not only numerous improvements, but also QtCreator's own development environment and convenient installers for all operating systems. Now, for development, you do not need to install the necessary environment yourself, set paths, integrate the library into ide — just run the installer and everything will work out of the box. Unfortunately, the windows version has an installer only for the 32-bit library build and ide. And sometimes there is a need to make exactly a 64-bit application - most often it is connected with the need to use other people's 64-bit components: loadable libraries, inproc com components, and other strange things. Under the cat contains detailed instructions on how to compile Qt and QtCreator from source for a 64-bit architecture.
A warning
The build will take about 6 hours and 8 gigabytes of hard disk space :).
Install the compiler
For correct operation of the debugger in QtCreator, it is recommended that you build a compiler from Microsoft.
Download the SDK
here , run the installer, and install the entire “developer tools” branch (almost everything from there is used to build Qt).
')
We collected source codes in a heap
Download the latest QtCreator 1.3 source
here and unpack the archive in
c:\qt\
Rename the unpacked folder to
2010.01.x64
Then download the latest Qt 4.6 sources
here and unpack the archive in
c:\qt\2010.01.x64
Rename the unpacked folder to
qt
Here you need to take into account that when compiling, folder names will be compiled into qmake and will not be changed. The folder names I gave correspond to where Qt installs the installer under windows.
Assembly
Run
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\Visual Studio 2008 x64 Win64 Command Prompt.lnk
In the opened console we sequentially execute:
cd c:\qt\2010.01.x64\qt
configure.exe
o
y
nmake
A call to configure.exe creates a makefile to build everything with a microsoft compiler (compiler
will be determined automatically, as we work in the visual studio command prompt - environment variables with us). “O” will select the open source license type (for free), “y” will confirm the license agreement. The nmake call is actually a microsoft utility for reading the makefiles and compiling what you need and what you don’t need. After nmake has worked (and it takes several hours), we don’t close the console and copy all .pdb files from
c:\qt\2010.01.x64\qt\lib
Because of the bugs in the makefile, they will be erased when deleting temporary files. Then we continue in the console:
nmake clean
set PATH=%PATH%;c:\qt\2010.01.x64\qt\bin
cd c:\qt\2010.01.x64
qmake "CONFIG+=release" -r
nmake release
Without closing the console, copy to the temporary folder all .pluginspec files from
c:\qt\2010.01.x64\lib\qtcreator\plugins\nokia
This is also a bug in the makefile. Then we continue in the console:
nmake clean
After everything has been compiled, move the .pdb and .pluginspec files back. QtCreator is compiled in the release version, since the debug build will run as a command-line application with a non-removable console.
File turning
After everything has been successfully collected, all .dll files in the ending of the name that do not have “d” are copied from the folder
c:\qt\2010.01.x64\qt\bin
to folder
c:\qt\2010.01.x64\bin
The QtCreator development environment runs as
c:\qt\2010.01.x64\bin\qtcreator.exe
Before calling, you must call
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat
This is to ensure that QtCreator works correctly with the compiler and debugger from Microsoft.
Launch QtCreator, select Tools-> Options-> Project, uncheck “Use jom”. You can, in principle, not to shoot, but then this same jom will need to be downloaded and copied into “bin”. Click "Apply".
Then select Tools-> Options-> Qt4-> QtVersions, click on the "+" in the upper right corner, in the field "Version Name" we write "Qt 4.6.0 x64", in the field "QMake location" we write
"C: \ qt \ 2010.01.x64 \ qt \ bin \ qmake.exe", set "MSVC Version" to "9.0", in the "Default Qt Version" field, select "Qt 4.6.0 x64" and click on the "Rebuild" button ". Choose Tools-> Options-> Help-> Documentation, click “Add” and add all .qch files from c: \ qt \ 2010.01.x64 \ qt \ doc \ qch
Generally all. Creating, editing, building and, best of all, debugging 64 bit Qt programs under windows is at your service. I say goodbye for this and wait for comments. If you have questions - I will try to answer. If you have a story to tell (maybe I did everything in vain and ready installers are already in the open spaces of the network :) - I will be grateful.
Updated 27.06.2010
To build with the recently released Visual Studio 2010 SDK, you must run configure.exe with the key
-platform win32-msvc2008
It is advisable to use the latest version of Qt from GIT and brunch 2.0 of Qt Creator from there.
git clone -b 2.0 git: //gitorious.org/qt-creator/qt-creator.git c: \ qt \ qt-creator.
Before launching, it is necessary to install perl and replace in qt / mkspecs / win32-msvc2010 / qmake.conf the fragment "QMAKE_CFLAGS_RELEASE = -O2 -MD" with "QMAKE_CFLAGS_RELEASE = -Od -MD".
Profit?
