7.1.2.  Installing Libraries

[ fromfile: reusinglibs.xml id: installingsoftware ]

TEMPLATE = lib      # Build this as a library, not as an application
DESTDIR=$$(CPPLIBS) # Place the compiled shared object code here
[Note] QTDIR

The environment variable QTDIR is not required by Qt, but we sometimes use it in different parts of the book to refer to the base directory of an unzipped Qt tarball. It provides a convenient way to refer to the location of the examples, tutorials, binaries, and libraries of Qt. However, on systems like Ubuntu or Debian, where Qt is split into multiple folders and installed to different locations, QTDIR should not be, and is not defined (if you are using the distro's version of Qt). In that case, you can interpret our usage of QTDIR to mean "the parent directory of the Qt binaries" or "the parent directory of the Qt examples" (which may be two different directories in that case).

[Note] QLibrary

The QLibrary class has methods to help you load and unload dynamic libraries at runtime in a platform-independent way.