Step 1
Download and install the LGPL Qt SDK for Windows. You can ommit installing MingGW; it is assumed that you have already installed Visual C++ Express Edition.
Step 2
Open Visual C++ Express Edition's command prompt. (Tools->Visual Studion Command Prompt)
Step 3
Change the directory to Qt installation direction (usually it is something like E:\Qt\2010.05\qt)
Step 4
run configure
(use options with it so that it will be onfigured to use with the msvc2010 platform
for e.g. configure -no-sql-sqlite -no-qt3support -no-opengl -platform win32-msvc2010
-no-libtiff -no-dbus -no-phonon -no-phonon-backend -no-webkit)
Step 5
Build Qt by typing nmake
Here is where you will encounter all sorts of trouble. It can stop abrubptly giving you an error message. Type nmake again and try to build it once more. It can get resolved automatically but if you are stuck with the same error like,
c:\Qt\2010.05\qt\src\3rdparty\webkit\WebCore\tmp\moc\debug_shared\moc_SocketStreamHandlePrivate.cpp(97) : error C2065: 'QSslError' : undeclared identifier2.c:\Qt\2010.05\qt\src\3rdparty\webkit\WebCore\tmp\moc\debug_shared\moc_SocketStreamHandlePrivate.cpp(97) : error C3861: 'socketSslErrors': identifier not found3.Generating Code...4.NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'5.Stop.6.NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'7.Stop.8.NMAKE : fatal error U1077: 'cd' : return code '0x2'9.Stop. or
then, you have to go and check for these files and delete them.
- delete files \src\script\tmp\moc\debug_shared\mocinclude.tmp and \src\script\tmp\moc\release_shared\mocinclude.tmp and restart nmake
- delete files \src\3rdparty\webkit\WebCore\tmp\moc\release_share d\mocinclude.tmp and \src\3rdparty\webkit\WebCore\tmp\moc\debug_shared\ mocinclude.tmp and restart nmake.
Step 6
Finally it is time to let the Visual C++ Express Edition know where the include, library and executable files of Qt are located at.
This can be easily done using a project property sheet.
- First go to View in VC++ Express Edition and check whether the Property Manger is there. If not, go to Tools->Settings and choose Expert Settings.
- Next, choose Property Manager from View; this will open up Property Manager side-by-side with solution explorer and Class view.
- Right click on top of your project name and since this is first time, click "Add New Project Property Sheet" and give a suitable name for your property sheet.
- By double clicking on the file name open the newly created property file.
- Under common properties->C/C++->Additional Include Directories, insert
- "..\..\..\include\QtCore";"..\..\..\include\QtGui";"..\..\..\include";"..\..\..\include\ActiveQt";
- Under common properties->Linker->Additional Library Directories, insert
- <your Qt directory>\2010.05\qt\lib;<your Qt directory>\2010.05\qt\lib;
- Under common properties->Linker->Input->Additional Dependencies
- <your Qt directory>\2010.05\qt\lib\qtmaind.lib;<your Qt directory>\2010.05\qt\lib\QtGuid4.lib;<your Qt directory>\2010.05\qt\lib\QtCored4.lib;
You can use this same property sheet when you create other Qt-based projects.