Wednesday 7 November 2012

Qt Installation 32bit


Qt Installation



Prerequisite
1.       Update.Net Framework into .Net Framework 4.
2.       Install windows SDK v7.1 by online installer while installing check all options in window from link http://www.microsoft.com/en-us/download/details.aspx?id=8279 [offline installer’s ISO file is having error].


1)        Using Qt SDK

1.       Download: Qt SDK for windows [QtSdk-offline-win-x86-v1.2.1].
2.       Install Qt SDK.
3.       Set following in Qt Creator.
4.       Follow step 5 of Qt Open Source with Creator for Creator settings after installation.
*SDK is not available with latest Qt libraries.

2)        Using Qt Open Source library with Creator

1.       Download Qt open source from  http://qt-project.org/downloads [qt-win-opensource-4.8.3-vs2008]
2.       Download Qt Creator [qt-creator-win-opensource-2.5.2].
3.       Install Qt open source library.
4.       Install Qt Creator [check in post mortem debugger option].
5.       Check following in creator
·         Go in Tools>> Options >> Build and Run



If there is no Qt version available click on add and locate Qt open source libraries folder go into bin and select qmake file [qmake.exe].
Path is C:\Qt\4.8.3\bin
In bin you will find qmake file.
·         Then  check Tool Chain tab in options window



Check Compiler version [it should be 32 bit version], debugger, and mkspec [32 bit].
If it is not present in Auto Detect click on add and locate folder of win SDK/Visual Studio and then check.
·         Now select Debugger in options and go on CDB tab
Check in Use CDB console.
Enter this path in Symbol Path
symsrv*symsrv.dll*C:\Users\volmo\AppData\Local\Temp\symbolcache*http://msdl.microsoft.com/download/symbols
Now click on Apply then Ok.
Restart Qt Creator.


3)        Using Qt add in Visual Studio

1.       Install Visual Studio 2008.
2.       Download Qt open source [qt-win-opensource-4.8.3-vs2008].
3.       Download QT visual studio add in [qt-vs-addin-1.1.11-opensource].
4.       Install Qt open source.
5.       Install Qt visual studio add in.

While making new project select classes which you have to use to avoid linker error.


Linker Error

In a console application a default .pro file have following content:
#-------------------------------------------------
#
# Project created by QtCreator 2012-11-06T16:24:44
#
#-------------------------------------------------

QT       += core

QT       -= gui

TARGET = untitled2
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app


SOURCES += main.cpp




Here :
QT       += core           include QtCore library
And next line QT       -= gui will remove GUI library.
If you are using some classes which are defined in another library modules [see class hierarchy of Qt for selecting right module] add them as of above syntax in .pro file else it will create linker error.
For example if you remove GUI library and then will use a push button it will generate following error:
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWidget::show(void)" (__imp_?show@QWidget@@QAEXXZ) referenced in function _main



Debugger Error


To remove this error check windows SDK folder if there is cdb.exe file selected.
If it is not selected then browse it in another folder locate it in Debugger. To browse it. Make clone of detected tool or add manually. Then find debugger’s exe [as cdb.exe] file and add it. Most probably you will find it in debugger tool. If you don’t find the tool in folders then download window SDK and search for debugger folder in it and locate the cdb.exe.   

No comments:

Post a Comment