Building Qt on a clean Kubuntu

I have to admit it - I always build my own Qt. Because of customers sticking to older versions and myself wanting to have the latest, I currently have 4 flavors of Qt and 3 of QtopiaCore sitting on my laptop.

As I recently invested in a new computer I felt that I had to build Qt + Qtopia on it. The computer was installed with a clean Kubuntu from the start. The problem is that Qt requires some packages to build and finding those packages is (at least for me) a tedious iterative process (make - look what failed - apt-get install it - repeat). So, without further ado, here is a list of packages that you need to get 4.3.4 X11 to build properly:
  • build-essential
  • libx11-dev
  • libxext-dev
So, make sure to apt-get install those before running ./configure && make && make install && echo -e "\a" . At least it keeps you from interrupting your I'm-compiling-thus-working-coffee-break. :-)

Sidenote: I guess Qt 4.4 requires some gstreamer goodies as well, I'll tell you when I get there.



At 10:16 AM, Anonymous arek said...

> "and finding those packages is ... a tedious iterative process (make - look what failed - apt-get install it - repeat)"

apt-get build-dep libqt3-mt libqtgui4
should do that on debian-based systems

At 10:22 AM, OpenID silentcoder said...

If the slackware packages are anything to go by, then the gstreamer packages you need are:

Other plugins are usefull but not required for QT.

However - there is an oddness there because the slackware build suggestions specify building QT before building gstreamer... I wonder if it's not the other way around. GST can work well with QT but only if you build it on a QT powered system. Presumably with debian packages, that isn't an issue then. But other KDE stuff like phonon DO require GST so it's good to get it anyway.

I have gone through the pains of getting QT to build on a clean platform recently, I gave up after 4 days of struggling and opted for a different platform that was already QT capable but if what I learned is helpful to somebody then it's worth it.

At 10:22 AM, Anonymous Anonymous said...

what about apt-get build-dep libqt4-dev or similar depending on the Qt version you build ?

At 10:38 AM, Blogger Johan Thelin said...

apt-get build-dep looks like a charm. Did not know about that earlier.

Nice to know that gstreamer and gst-plugin-base are the ones needed. Don't I need some sort of -dev package as well?

At 11:21 AM, Anonymous Wysota said...

Johan, I'm sure your laptop is multicore so you can call make -jX where X is the number of cores/processors available and have a shorter coffee break.

You can even use solutions for distributed compilation (distcc or teambuilder) and have your package built much faster as I'm sure you have more than one machine in your beautiful house :)

At 11:28 AM, Blogger Johan Thelin said...

Actually, I did a -j4... just didn't want to brag about it :-)

At 12:45 PM, Anonymous David Boddie said...

An overview of the dependencies on X11 can be found here:


Of course, you'll need the development packages of these to build Qt from source. :-)

At 6:55 PM, Anonymous Gustavo Noronha said...

Also, try auto-apt, it is a really nice tool that takes away _some_ of the tediousness. You can do, for instance:

$ auto-apt run ./configure

See section 6.4.13 Automatically install command, here: http://www.debian.org/doc/manuals/reference/ch-package.en.html

At 7:34 AM, Anonymous Wysota said...

Actually, I did a -j4... just didn't want to brag about it :-)

And you should have because many people are not aware of the -j switch.


Post a Comment

<< Home