Beyond Linux From Scratch - Version 6.0

Part VIII. X + Window Managers

X Libraries

This chapter does not contain libraries that are required to run
X. It does contain libraries that
enhance X. In some cases the
enhancement is as simple as font support. In others it is as complex
as libraries that sit between X and
applications that run on X whose
purpose is to standardize the look and feel and inter-process
communications for different applications. They also assist
programmers by supplying common elements.

Qt-3.3.3

Introduction to Qt

The Qt package contains a
C++GUI library. This is useful for creating
graphical applications or executing graphical applications that
are dynamically linked to the Qt
library. One of the major users of Qt is KDE.

Qt dependencies

Required

Recommended

Optional

Installation of Qt

There are several ways to install a complicated package such as
Qt. The files are not completely
position independent. Installation procedures execute the program
pkg-config to
determine the location of package executables, libraries,
headers, and other files. For Qt, pkg-config will look for the file
lib/pkgconfig/qt-mt.pc which must be
modified if relocating the package. This file is set up correctly
by the build process.

The default installation places the files in /usr/local/qt/. Many commercial distributions
place the files in the system's /usr
hierarchy. The package can also be installed in an arbitrary
directory.

This section will demonstrate two different methods.

Note

The build time for Qt is
quite long. If you want to save some time and don't want the
tutorials and examples, change the first make line to:

make sub-tools

Method 1 -
Installing in the /usr
hierarchy

The advantage of this method is that no updates to the
/etc/ld.so.conf or /etc/man.conf files are required. The package
files are distributed within several subdirectories of the
/usr hierarchy. This is the method
that most commercial distributions use.

Method 2 -
Installing in /opt

This is the method recommended by the Qt developers. It has the advantage of
keeping all the package files consolidated in a dedicated
directory hierarchy. By using this method, an update can be
made without overwriting a previous installation and users can
easily revert to a previous version by changing one symbolic
link.

The Qt developers use a
default location of /usr/local/qt/,
however this procedure puts the files in /opt/qt-3.3.3/ and then creates a symbolic link
to /opt/qt/.

Update the PKG_CONFIG_PATH environment
variable in your ~/.bash_profile or
/etc/profile with the following:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig

The QTDIR environment variable needs to
be set when building packages that depend on Qt. Add the following to the .bash_profile initialization script for each
user that builds packages using the Qt libraries. Alternatively, the variable
can be set in the system wide /etc/profile file.

export QTDIR=/opt/qt

If you want the Qt executables
in your shell search path, update the PATH environment variable in your ~/.bash_profile or /etc/profile to include /opt/qt/bin.

As with most libraries, there is no explicit configuration to
do. After updating /etc/ld.so.conf as
explained above, run /sbin/ldconfig so that
ldd can find the
shared libraries.

Contents

The Qt/X11 library contains APIs necessary to use programs based on the
QtGUI toolkit.