User Tools

Site Tools


qt

Qt

Other Qt Pages

Compiling Qt under (k)ubuntu

  • Download and extract Qt
  • Use
    sudo apt-get install</sourc> to install the following packages:
        * openssl
        * libssl-dev
        * xorg-dev
        * build-essential
      * Configure with the following line
    <code bash>
    ./configure -no-phonon -no-webkit -no-opengl -openssl
  • Build and install with the commands
(g)make install
sudo (g)make install

Building a minimal set of libraries only

If you only want the Qt libraries, and none of the tools or examples, you can save time by using the following command lines

./configure -no-phonon -no-webkit -no-opengl -openssl -nomake examples -nomake demos
(g)make
sudo (g)make install

Compiling Qt under Windows/Visual Studio

  • Download and extract Qt to C:\build\<version>
  • Download and extract OpenSSL to C:\build\openssl-0.9.8g. Build it.
  • Download and install the Windows SDK (formerly Platform SDK, at the time of writing v6.1)
  • For Phonon support, download and install the full DirectX SDK (at time of writing, November 2007 release)
  • Set the following environment variables
OPENSSL_PATH = C:\build\openssl-0.9.8g
PATH += C:\build\qt-win-opensource-src-4.4.0\bin
QMAKESPEC = win32-msvc2005
  • Run a platform sdk command prompt (The yellow one)
  • For Phonon support, execute the DirectX environment script
C:\Program Files\Microsoft DirectX SDK (November 2007)\Utilities\Bin\dx_setenv.cmd
  • Configure with the following command lines
cd c:\build\qt-win-opensource-src-4.4.0\
configure.exe -debug-and-release -phonon -webkit -direct3d -openssl -I C:\build\Include -L C:\build\Lib

Check the beginning of the output of configure, and ensure all selected options have been correctly enabled)

  • Compile with the following command line
nmake

Improved Debugging output

  • Find the autoexp.dat file within the visual studio installation directory and add the following lines just before the Visualiser section
; Qt Integration
QObject =classname=<staticMetaObject.d.stringdata,s> superclassname=<staticMetaObject.d.superdata->d.stringdata,s>
QList<*>=size=<d->end,i>
QLinkedList<*>=size=<d->end,i>
QString=<d->data,su> size=<d->size,u>
QByteArray=<d->data,s> size=<d->size,u>
QUrl =<d->encodedOriginal.d->data,s>
QUrlInfo =<d->name.d->data,su>
QPoint =x=<xp> y=<yp>
QPointF =x=<xp> y=<yp>
QRect =x1=<x1> y1=<y1> x2=<x2> y2=<y2>
QRectF =x=<xp> y=<yp> w=<w> h=<h>
QSize =width=<wd> height=<ht>
QSizeF =width=<wd> height=<ht>
QMap<*> =size=<d->size>
QVector<*> =size=<d->size>
QHash<*> =size=<d->size>
QVarLengthArray<*> =size=<s> data=<ptr>
QFont =family=<d->request.family.d->data,su> size=<d->request.pointSize, f>
QDomNode =name=<impl->name.d->data,su> value=<impl->value.d->data,su>

Making a project with qmake

  • Create a new project file with the following commandline
qmake -project -t app -o projectname.pro

(In the current version of qmake, the template does not always get correctly applied, it can be fixed with the template below).

  - Visual Studio 2005 template
TEMPLATE = app
  - Output binary name
TARGET = myproject
DEPENDPATH += .
 
  - Which Qt modules to include
QT += network
  - Additional condiguration
CONFIG += warn_on thread 
CONFIG -= embed_manifest_exe 
 
  - Show a console with stderr output in debug mode
win32:CONFIG += console
 
  - Input
HEADERS += main.h
SOURCES += main.cpp

Creating the Visual Studio project files

Once the .pro file is made, and indeed every time it is changed, use the following commandline to generate the Visual Studio project files

qmake -tp vc

The project can then be opened in visual studio and compiled as ususal

qt.txt · Last modified: 2014/11/24 02:18 by ben