Qt Build Environment

Currently there are two desktop tools in SVN that are based on the Qt4 framework. Qt4 is available for all major Operating Systems (Linux, Windows, MacOS X).

Setup on Windows (2000, XP, Vista, 7)

On Windows Qt itself support various compilers. We're only using the gcc compiler as provided by the MinGW project. You also need some additional tools that are standard on Unix systems.

Qt4

You need a Qt framework that is build with the MinGW gcc compiler and the used compiler. The easiest way is to install the Qt SDK which includes a pre-built Qt and the MinGW compiler. The SDK also includes the integrated development environment Qt Creator.

Note: The Qt SDK does not include libz in its MinGW installation. This is not a bug in the SDK because you can link libz implicitly, we want to link it explicitly though. You can simply add this by downloading the libz dll and dev packages from the MinGW website and extracting the archives into the MinGW installation.

MinGW

Note: The Qt SDK comes with MinGW bundled. If you installed the Qt SDK you don't need to install MinGW separately.

If you want to go the manual route you can also install MinGW yourself (follow the instructions on the MinGW website). You then can use the "Qt libraries" from the Qt website instead or get the source and build Qt yourself.

MSYS

Various Makefiles use Unix tools that are not present on Windows. The easiest way to get those is to install MSYS 1.0.11. Newer versions of MSYS don't come bundled as installer, but that version is sufficient.

Environment

Both MinGW and MSYS needs to be accessible from within the PATH environment variable. To do this you can

add the paths permanently to the PATH environment variable. Make sure both MSYS and MinGW are at the beginning of the

PATH list. Note: This might override some Windows programs and cause issues with other programs.

manually set the PATH environment variable when starting the command line. This is as simple as typing set PATH=c:\MSYS\1.0\bin;c:\Qt\2010.04\mingw\bin;%PATH%.

create a cmd script that sets the environment variable and keeps a window open. You can then invoke this script instead of running cmd.exe for building.

Rockbox source code

Setup on Linux

Qt is part of all major Linux distributions. Install the developments tools (various distributions have package groups for that) and the Qt development package (you also need qmake which is part of Qt. Some distributions split it out into a separate package). Note: some distributions install the qmake binary as qmake-qt4.

Setup on Mac OS X

You need to install

XCode (available on the OS X installation disk and at the Apple website)

Qt itself. If you intend to build universal binaries you need the Carbon version of Qt. Installing the libraries version is sufficient for compiling.

Building Qt4

Note: you don't need to build Qt4 yourself if you installed the Qt SDK and don't want to build statically linked binaries.

To create binaries that are statically linked against Qt you need to rebuild Qt statically. A statically built Qt is used for building the binaries provided to avoid having to extract additional DLL files.