Skip to content
[dk]

~/blog/build-qt-4-8-4-on-ubuntu-12-04.md

Building Qt 4.8.4 on Ubuntu 12.04

This post was written more than 13 years ago. Some of it may be out of date.

First, download Qt from the link below. Qt 5 was already available, but this time I downloaded 4.8.4. http://qt-project.org/downloads

After downloading it, extract the archive, move into the extracted directory, and run the command below. This build uses the open-source edition, disables Qt3 support, and skips building the examples and demos. You can see the detailed options with configure -help.

$ ./configure -prefix ~/Lib/Qt-4.8.4 -opensource -confirm-license -no-qt3support -nomake examples -nomake demos

Partway through, I hit the following error.

Basic XLib functionality test failed!
ou might need to modify the include and library search paths by editing
MAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/daisuke/Downloads/qt-everywhere-opensource-src-4.8.4/mkspecs/linux-g++.

After checking the document below, it turned out that the required packages were not installed.

Install the required packages listed in http://qt-project.org/doc/qt-4.8/requirements-x11.html.

$ sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxrandr-dev libxrender-dev

When I ran configure again, it completed successfully.

$ ./configure -prefix ~/Lib/Qt-4.8.4 -opensource -confirm-license -no-qt3support -nomake examples -nomake demos

After configure finishes, build and install it with the commands below.

$ make
$ make install

Added on 2013-07-27

If you do not set the QMAKESPEC environment variable, configure fails.

$ export QMAKESPEC=/home/daisuke/Downloads/qt-everywhere-opensource-src-4.8.4/mkspecs/linux-g++

If OpenGL is not enabled, refer to this page.

$ related --same-tags

cd .. Back to all posts