2

I installed qt5.4 from here in Ubuntu 14.04, but when I run:

qmake -v

I always get the old version Qt5.2.1, although I think it is installed here Qt version 5.4.2 in /opt/qt54/lib. Can anyone tell me how to make sure that Qt5.4.2 is installed properly?

Thanks

karel
  • 114,770

2 Answers2

0

You might have both versions installed, use whereis command to find about all available instance of a program:

whereis command-name

e.g:

whereis qmake

it will tell you if any other version was available, then you can use absolute path to find about its version, like:

/usr/local/bin/qmake -v
Ravexina
  • 55,668
  • 25
  • 164
  • 183
  • yeah i can see it now in: QMake version 3.0 Using Qt version 5.4.2 in /opt/qt54/lib but he is taken into consideration the previous one: Project MESSAGE: Qt version 5.2.1 Project ERROR: Unknown module(s) in QT: quickwidgets – B.andalous Jun 03 '17 at 15:20
  • How to make it consider QT5.4.2 version. Thanks – B.andalous Jun 03 '17 at 15:27
  • what was the output of whereis qmake ? – Ravexina Jun 03 '17 at 15:31
  • here it is the output : qmake: /usr/bin/qmake /usr/bin/X11/qmake /opt/qt54/bin/qmake Qt5.4.2 is in /opt/qt54/bin/qmake . kindly tell me how to make it as a default – B.andalous Jun 03 '17 at 16:56
  • So it's installed in /opt my suggestion is to create an alias: alias qmake="/opt/qt54/bin/qmake" you can add this line at the end of ~/.bashrc so it will be available in all your terminals. – Ravexina Jun 03 '17 at 16:57
  • I did it but still when i do qmake -v the Qt5.2.1 appears. Any other suggestions please – B.andalous Jun 03 '17 at 17:10
  • what is the output of /opt/qt54/bin/qmake -v ? – Ravexina Jun 03 '17 at 17:11
  • here it is the output Using Qt version 5.4.2 in /opt/qt54/lib but when i compile to install ardupilot it uses Qt5.2.1 how can i change it to Qt5.4.2 – B.andalous Jun 03 '17 at 17:14
  • I'm not sure about that, you can do something like this (Not a good Idea): sudo mv /usr/bin/qmake /usr/bin/qmake-bk then sudo ln -s /opt/qt54/bin/qmake /usr/bin/qmake – Ravexina Jun 03 '17 at 17:24
  • Well guys, I could make Qt5.4.2 as a default by just editing default.conf in /usr/lib/x86_64-linux-gnu/qtchooser .I just added the path of Qt5.4.2. Thanks – B.andalous Jun 04 '17 at 21:25
0

Look in /opt/qt54/bin for a file called qt54-env.sh. If the file is not there open Files file browser at /opt/qt54/ and search for qt54-env.sh from there. Source /opt/qt54/lib/qt54-env.sh to set the correct environment.

cd  
source /opt/qt54/lib/qt54-env.sh
karel
  • 114,770