Tuesday, October 30, 2007

Hands on KDevelop, QT4, SDL

Got my hands on KDevelop, QT4 and SDL... ...well, just some Hello World stuff.

The good news: I was able to do what I wanted. Everything needed to make my own programs with a nice GUI (QT4), or even cross platform multimedia applications (using SDL) can be installed through the Synaptic Package Manager.

The bad news: One would assume that installing an environment for a C++ 'Hello World' application would be as simple as installing a development IDE (KDevelop), create a "new Hello World Project", compile and run. This isn't exactly the case. Everything went well until I tried to compile. Then I had to go through a painful process of installing additional packages related to the compiler, the automated creation of makefiles (e.g. what the heck is this AM_PROG_TOOL stuff?!), 'konsole', etc.!

Here is a list of steps and packages I have added:

1) Add KDevelop (just add KDevelop, all the other packages will be selected automatically):
cvs (1:1.12.13-8)
kdebase-bin (4:3.5.8-0ubuntu2)
kdelibs-data (4:3.5.8-0ubuntu3.1)
kdelibs4c2a (4:3.5.8-0ubuntu3.1)
kdevelop (4:3.5.0-0ubuntu2)
kdevelop-data (4:3.5.0-0ubuntu2)
libapr1 (1.2.7-8.2ubuntu1)
libaprutil1 (1.2.7+dfsg-2build1)
libarts1c2a (1.5.8-0ubuntu1)
libartsc0 (1.5.8-0ubuntu1)
libaudio2 (1.9-2)
libavahi-qt3-1 (0.6.20-2ubuntu3)
libcvsservice0 (4:3.5.8-0ubuntu1)
liblua50 (5.0.3-2build1)
liblualib50 (5.0.3-2build1)
libopenexr2c2a (1.2.2-4.3ubuntu2)
libpq5 (8.2.5-1.1)
libqt3-mt (3:3.3.8really3.3.7-0ubuntu11)
libsvn1 (1.4.4dfsg1-1ubuntu3)

2) Add the g++ compiler:
g++ (4:4.1.2-9ubuntu2)
g++-4.1 (4.1.2-16ubuntu2)
libstdc++6-4.1-dev (4.1.2-16ubuntu2)

3) Sort out problems related to the automated creation of makefiles (this step was quite cumbersome!):
build-essential (11.3ubuntu1)
dpkg-dev (1.14.5ubuntu16)
autoconf (2.61-4)
autoconf-doc (2.61-0ubuntu1)
automake (1:1.10+nogfdl-1)
automake1.10-doc (1.10-1)
autotools-dev (20070306.1)
m4 (1.4.10-0ubuntu2)
autobook (1.4.4-unofficial-4)
patch (2.5.9-4)
libtool (1.5.24-1ubuntu1)
libtool-doc (1.5.24-1ubuntu1)

4) konsole (yes, written with k!)
konsole (4:3.5.8-0ubuntu2)¨

5) QT Designer (Just add QTDesigner, the rest will be added automatically):
comerr-dev (2.1-1.40.2-1ubuntu1)
libaudio-dev (1.9-2)
libc6-dev (2.6.1-1ubuntu9)
libexpat1-dev (1.95.8-4ubuntu1)
libfontconfig1-dev (2.4.2-1.2ubuntu4)
libfreetype6-dev (2.3.5-1ubuntu4)
libgl1-mesa-dev (7.0.1-1ubuntu3)
libglib2.0-dev (2.14.1-1ubuntu1)
libglu1-mesa-dev (7.0.1-1ubuntu3)
libglu1-xorg-dev (1:7.2-5ubuntu13)
libice-dev (2:1.0.3-3)
libjpeg62-dev (6b-14)
libkadm55 (1.6.dfsg.1-7build1)
libkrb5-dev (1.6.dfsg.1-7build1)
liblcms1-dev (1.16-5ubuntu3)
libmng-dev (1.0.9-1)
libmysqlclient15off (5.0.45-1ubuntu3)
libpng12-dev (1.2.15~beta5-2ubuntu0.1)
libpq-dev (8.2.5-1.1)
libqt4-core (4.3.2-0ubuntu3)
libqt4-dev (4.3.2-0ubuntu3)
libqt4-gui (4.3.2-0ubuntu3)
libqt4-qt3support (4.3.2-0ubuntu3)
libqt4-sql (4.3.2-0ubuntu3)
libsm-dev (2:1.0.3-1)
libsqlite0 (2.8.17-2.1build1)
libsqlite0-dev (2.8.17-2.1build1)
libssl-dev (0.9.8e-5ubuntu3.1)
libx11-dev (2:1.1.1-1ubuntu4)
libxau-dev (1:1.0.3-2)
libxcursor-dev (1:1.1.8-2)
libxdmcp-dev (1:1.0.2-2)
libxext-dev (2:1.0.3-2build1)
libxfixes-dev (1:4.0.3-2)
libxft-dev (2.1.12-2ubuntu4)
libxi-dev (2:1.1.2-1)
libxinerama-dev (2:1.0.2-1build1)
libxmu-dev (2:1.0.3-1ubuntu1)
libxmu-headers (2:1.0.3-1ubuntu1)
libxrandr-dev (2:1.2.1-1)
libxrender-dev (1:0.9.2-1)
libxt-dev (1:1.0.5-3)
linux-libc-dev (2.6.22-14.46)
mesa-common-dev (7.0.1-1ubuntu3)
mysql-common (5.0.45-1ubuntu3)
qt4-designer (4.3.2-0ubuntu3)
x11proto-core-dev (7.0.10-2)
x11proto-fixes-dev (1:4.0-2ubuntu1)
x11proto-input-dev (1.4.2-1)
x11proto-kb-dev (1.0.3-2ubuntu1)
x11proto-randr-dev (1.2.1-2)
x11proto-render-dev (2:0.9.2-4ubuntu1)
x11proto-xext-dev (7.0.2-5ubuntu1)
x11proto-xinerama-dev (1.1.2-4ubuntu1)
xlibmesa-gl-dev (1:7.2-5ubuntu13)
xtrans-dev (1.0.3-2)
zlib1g-dev (1:1.2.3.3.dfsg-5ubuntu2)

6) SDL:
libflac-dev (1.1.4-3ubuntu1)
libmikmod2 (3.1.11-a-6ubuntu3)
libmikmod2-dev (3.1.11-a-6ubuntu3)
libogg-dev (1.1.3-2ubuntu2)
libsdl-console (1.3-4)
libsdl-console-dev (1.3-4)
libsdl-gfx1.2-4 (2.0.13-3)
libsdl-gfx1.2-dev (2.0.13-3)
libsdl-image1.2 (1.2.5-3)
libsdl-image1.2-dev (1.2.5-3)
libsdl-mixer1.2 (1.2.6-3)
libsdl-mixer1.2-dev (1.2.6-3)
libsdl-net1.2 (1.2.5-7)
libsdl-net1.2-dev (1.2.5-7)
libsdl-sge (030809dfsg-1ubuntu1)
libsdl-sge-dev (030809dfsg-1ubuntu1)
libsdl-sound1.2 (1.0.1-12build2)
libsdl-sound1.2-dev (1.0.1-12build2)
libsdl-stretch-0-2 (0.2.3-7)
libsdl-stretch-dev (0.2.3-7)
libsdl-ttf2.0-0 (2.0.9-1)
libsdl-ttf2.0-dev (2.0.9-1)
libsdl1.2-dev (1.2.11-9ubuntu2)
libsmpeg-dev (0.4.5+cvs20030824-2)
libsmpeg0 (0.4.5+cvs20030824-2)
libspeex-dev (1.1.12-3)
libtiff4-dev (3.8.2-7ubuntu2)
libtiffxx0c2 (3.8.2-7ubuntu2)
libvorbis-dev (1.2.0.dfsg-1)

So, with this packages, I am now really able to easily create 'Hello World' programs for both QT4 and SDL.

I don't know exactly what I should think now. On one hand, I am happy that I was able to sort out the problems myself (well, with the help of Google). On the other hand, compared to VisualStudio this was a rather cumbersome and geeky start. I wonder if there are some super-developer-packages that can be selected by a novice, and it will just select all sub-packages automatically to make sure that the first impression will be truly painless?

Generally, not being afraid of facing whatever unexpected problem occurs and sort it all out step by step is definitely something essential in the Linux World. I don't really have a problem with that, except that it eats up so much precious time, and even after having sorted out all the problems the overall feeling of being stupid and not having understood everything in full detail remains...

3 comments:

lexip said...

One of the problems here was, that you probably are using Ubuntu with the standart Gnome environment. Gnome is based on GTK 2.0. Thus if you are now starting to develop for QT4 with KDevelop (which ist KDE based), you have to install all needed packages. If you went with GTK 2.0 and Glade http://glade.gnome.org/ interface designer, you would have had less packages installed.
But basically yes, there are lots of libraries around in the linux world; if you want to use it, you have to install the corresponding packages

Yannick said...

as you're in your linux-dev discovery phase I can warmly recommend to have a look at Ant or CMake. Basically the task these tools fulfil is the same as automake does in some way, but different: Ant (very popular, easy to handle and powerful) and CMake (not sooo popular, but the very first choice for more complex projects with dependencies) http://www.cmake.org/HTML/Index.html

creative mind said...

lexip: Is Glade as powerful as Qt for cross platform GUI development? And what is your preferred Editor for designing GUIs with Glade?