PDA

View Full Version : How to switch Qt4 version



vieraci
1st May 2007, 09:37
Qt3 and Qt4 were installed during installation of my openSuse 10.2.
There's one version in /usr/lib/Qt3
and another in /usr/lib/Qt4

I had to download Qt4.2.3 source code and build it so I could have the SQL plugins for Firebird.
"qmake install" put Qt4.2.3 in /usr/local/Trolltech/Qt-4.2.3

I've tested the new installation by changing the program icon in the menu to point to designer in the new path, it works fine, and I have a working database plugin.

Now there's a qmake is in /usr/bin and another in /usr/bin/X11, AND I now have another one in /usr/local/Trolltech/Qt-4.2.3/bin

When it comes to compiling my program, the qmake that will get used will be the one in /usr/bin,which is version 4.2.1. Question is, what's the proper method of making the new installation the default ? Should I just copy the new files over the old ones ?

marcel
1st May 2007, 18:17
No, the best way is to change the QTDIR env var to the installation you want, and then add $QTDIR/bin to path, at the BEGINNING, because /usr/bin is already there. This way, qmake 4.2.3 will be the "default".

Ideally, when you compile and install a new Qt version, you should specify the install dirs when configuring ( bin, lib, etc ). For example, the base install dir could have been /opt/qt-4.2.3. This way you don't have all sorts of installations spread all over the system. Uninstalling is easier this way also.

Regards