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...

Sunday, October 28, 2007

Ubuntu Display Resolution

The first thing I had to resolve manually was that Ubuntu come up with a resolution of 1280x768 on my LCD Monitor with 1280x1024 (which looked horrible).
First I thought the problem might be related to my display adapter/driver (ATI Radeon 9800 PRO), so after some research I tried to update my driver with some heroic shell stunts, e.g.:

sudo arp-get install xorg-driver-fglrx

Although this command was a good exercise and forced me to learn about sudo and arp-get, and even magically downloads some driver stuff and installs it, the result was that I lost the hardware accelerated 3D desktop. And I was not able to switch back again to the original driver or the original settings - As a true dummy user, I ended up reinstalling the whole beast to get the hardware accelerated 3D back..!

Next thing I played with was the tool found in the menu:
System/Administration/Screens and Graphics.
There I changed the settings of Screen1 to "LCD Panel 1280x1024" and "Resolution=1280x1024". This already did half the job, but after a restart of the system, the desktop was again at 1280x1024. After a while I found that changing the resolution to 1280x1024 in the Menu
System/Preferences/Screen Resolution
is necessary too.

So, my recipe for changing the screen resolution is:
1) DON'T change the display driver as long as hardware accelerated 3D is working
2) Change settings of "Screens and Graphics"
3) Change settings of "Screen Resolution"
4) Make sure that the settings remain with a full restart of the PC

Note: Afaik, this settings basically just change /etc/X11/xorg.conf

Friday, October 26, 2007

Ubuntu default Installation + optional packages

The installation of Ubuntu 7.10 went without a glitch. I installed it on a PC where I already had Windows but an empty partition on my harddrive. During the installation, I just had to select the right partition, which was easy because I could recognize it by its size. After that, it installed a whole dual boot setup (which allows me to boot into linux or windows) automatically.

After the first reboot of the installation, it automatically asked me to install some updates over the internet, and it did so without the slightest problem.

The Ubuntu Package Managers from the Menus
Applications/Add/Remove
System/Administration/Synaptic Package Manager
allow to install all kind of packages (more than 20'000!) in a most easy way. No need to browse for programs on the internet, everything that works can be accessed directly through the desktop! That's just awesome!

Thursday, October 25, 2007

Going for Ubuntu

I have been a Windows enthusiast for years, mainly because I am a realtime graphics fanatic and because there is nothing that compares to DirectX, at least not in terms of multiple layers of high resolution videos as textures on 3D objects.

My enthusiasm for Windows has dropped over the years, today I just see it as a good and stable operating system. The main reason to keep it is for MS Office compatibility and its .NET development environment. But I have to admit that Windows Vista is quite a disappointment and I feel forced to check alternatives, that is, Mac OS X or Linux. While Mac OS X is probably quite nice in some aspects, I somehow don't see a true necessity to favor it over Linux.

After some research, I decided for Ubuntu 7.10 (based on Debian), because
- it is very popular (hence, its future looks promising)
- it seems to allow a soft start without too much shell knowhow
- it seems to be the choice of the linux multimedia programmers (gstreamer - the equivalent to DirectShow)
- it comes by default with really nice 3D desktop features, based on GNOME and compiz

I decided to start a blog and write down my little adventures with Ubuntu. It will hopefully help others and also me myself to not forget about how to deal with specific issues.

If you are a novice or expert Linux user and would like to write some posts in this blog too, just let me know, I will be glad to add you as an author!