Compiling QCTOOL

Compiling QCTOOL

This page describes compilation of QCTOOL v2. For instructions on compiling older versions, see Compiling QCTOOL v1.


QCTOOL requires the following external libraries which must be installed (with headers) before compilation:

Zlib is already installed on most systems.

QCTOOL also uses the following libraries which are included in the qctool repository and don't need to be installed beforehand:

Downloading QCTOOL

See the page on downloading QCTOOL for download instructions.

Compiling QCTOOL

QCTOOL compilation is done in two parts: the configure step, which tries to find any needed prerequisites or optionally used libraries, and the build step which compiles qctool. A basic sequence goes like this:

$ ./waf-1.5.18 configure
$ ./waf-1.5.18

Note: the build process currently works best if you are using python version 2. See Issue #74 for what might happen if not.

Note: the configure step may report some libraries can't be found. That's generally ok as long as the 'configure' finished successfully message appears.

Compilation options

You may need to tweak the configuration step in order to successfully compile qctool. Here are some tips on this.

Setting install location: adding --prefix to the configure step:

./waf-1.5.18 configure --prefix=/my/favourite/path
You can then run ./waf-1.5.18 install after the build, which will copy qctool to /my/favourite/path/bin/qctool-<version>.

Specifying the compiler: A C++ compiler can be specified by setting the CXX environment variable to the configure step, e.g.

CXX=/path/to/c++/compiler/g++ ./waf-1.5.18 configure
The specified compiler will be used throughout. Some components used by qctool (e.g. sqlite) use a C compiler instead; to specify that set the CC environment variable.

** Specifying compiler and linker flags **: To specify specific flags to be used during compilation or linking, use the CXXFLAGS and LINKFLAGS environment variables. E.g.:

CXXFLAGS="-march native" ./waf-1.5.18 configure

Debugging qctool

By default the build step compiles all files twice - once in release mode (output in build/release/) which are optimised builds that you should use for most tasks, and once in debug mode (output in build/default/) which is useful if you want to run QCTOOL in a debugger. For example, you can run qctool in gdb like so:

$ gdb ./build/default/qctool-<version>
(gdb) run
QCTOOL tries to give useful error messages in case of problems, but it's not perfect and the debugger can help in these situations.

Reporting problems

If you're still having problems compiling QCTOOL, please check for related issues on the QCTOOL issue tracker. If all else fails, please raise a new issue there.