Ubuntu 14.04 - choosing Qt version

I have mistakenly updated my qt version from 4.8.5 to 4.8.6. This happened as a result of installing pacon anaconda.

However, I'm working on a project that needs qt 4.8.5.

Running qmake -v

shows:

$ qmake -v
QMake version 2.01a
Using Qt version 4.8.6 in home/<username>/anaconda/lib

      

How do I switch to my previous version of qt (installed in the default directory i.e. / usr / ...)?

qtchooser

the following parameters are listed:

$ qtchooser -list-versions
4
5
default
qt4-i386-linux-gnu
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5

      

But trying export QT_SELECT

with every parameter didn't change the message:

Using Qt version 4.8.6 in home/<username>/anaconda/lib

      

I would appreciate your help.

+3


source to share


1 answer


You can use multiple versions of Qt easily. All you have to do is call qmake

, which comes with the required version. For example:

/usr/local/Trolltech/Qt-4.8.5/bin/qmake -v

      



When using, QtCreator

you can add the Qt version to Tools/Options.../Build & Run

and switch between Qt versions in the project settings (some versions QtCreator

will not also require creating a set, which is not very difficult).

The only problem I ran into was using cmake

(hate this piece of garbage). In this case, you will need to change the order in which qmake

different versions are called. First of all, find out where your default qmake

( which qmake

) is, and then if it is a symbolic link or not (strange that Qt installed in your home directory is called without using the full path). If it is a link, then change it from one version of Qt to another. If not, check echo $PATH

. What you can do: You can create a symbolic link for Qt4.8.5 qmake

to the directory that precedes the one in which Qt4.8.6 qmake

is. Or you can add a path to it in your $PATH

first position ( sudo nano /etc/environment

. Important) on some operating systems / etc / environment will be empty. In this case, you need to write the whole $PATH

there like echo PATH=\"/usr/local/Trolltech/Qt-4.8.5/bin:$PATH\" > /etc/environment

).

+3


source







All Articles