Kontron KTAM3874-pITX User Manual
Page 174

KTD-S0057-I
Page 170 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
10.12.4 Qt
TM
4.8
Qt
TM
is a cross-platform environment and UI framework with native C++ libraries, declarative UI language
and tools in order to build complex applications for desktop, embedded and mobile computers. On an x86
Desktop PC using a cross compiler (Ubuntu
TM
environment) you need some additional libraries (application
dependent):
QtCore
QtGui
QtDBus
glib-2.0
png12
expat
pcre
uuid
z (libz)
Some Qt
TM
dynamic libraries are available within the standard Debian
TM
image (have a look at the di-
rectories
/usr/lib/arm-linux-gnueabihf
and
/lib/arm-linux-gnueabihf
), especially these five libraries:
QtCore.so.4.8.2, QtGui.so.4.8.2, QtDBus.so.4.8.2, QtCLucene.so.4.8.2 and QtXml.so.4.8.2. The best way
for development consists in the use of these libraries which should be copied from the target hardware to
the cross compiler environment. Maybe a link creation or renaming of library files could be required. You
also need some additional Include-files which typically are not available. For smaller applications the
download of
libqt4-dev
on the x86 Desktop PC offers a sufficient way with
sudo apt-get install libqt4-dev
Now you have access to the new Include parent directory
/usr/include/qt4
and also to the important new
base directory
/usr/share/qt4
. The following examples will not need the Qt
TM
Creator or qmake, therefore a
small manual adjustment is necessary. After the download of
libqt4-dev
the development environment uses
x86 settings. By switching two definitions in the file
/usr/include/qt4/QtCore/qconfig.h
Qt
TM
compiles for ARM environment and creates an ARM executable (changes in orange color):
/* Everything */
/* Qt Edition */
#ifndef QT_EDITION
# define QT_EDITION QT_EDITION_OPENSOURCE
#endif
/* Machine byte-order */
#define Q_BIG_ENDIAN 4321
#define Q_LITTLE_ENDIAN 1234
/*#define QT_BUILD_KEY "i386 linux g++-4 full-config"*/
/*#define QT_BUILD_KEY_COMPAT "i686 Linux g++-4 full-config"*/
#define QT_BUILD_KEY "arm linux g++-4 full-config"
#ifdef QT_BOOTSTRAPPED
#define Q_BYTE_ORDER Q_LITTLE_ENDIAN
#else
#define Q_BYTE_ORDER Q_LITTLE_ENDIAN
#endif