Qt5 alternative installation

Qt5 libraries can be installed using binary installer downloaded from the developpers site. This way can be used if your Unix distribution doesn't have Qt5 available in the package manager, or you would like to have the latest Qt5 on your system. Below we provide the recipe, that we used, to install the latest Qt5 libraries on our MacOS and Linux operation systems

MacOS systems
  • Download Qt Online Installer for Mac from the developers site.
  • Run the installer, then follow the instructions. By default Qt will be installed in the directory /Users/yourname/Qt.
  • After the installation insert following environment variables into .profile file of your home directory:
$ export QTDIR=/Users/yourname/Qt/5.3/clang_64
$ export PATH=$QTDIR/bin:$PATH
$ export DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH
  • You have to adjust the QTDIR variable for the Qt version number and yourname to point to the right Qt directory.
Open new terminal and validate that qmake --version command gives you the right Qt version you have just installed:
> Using Qt version 5.7.0 in /Users/yourname/Qt/5.7/clang_64/lib

 

Linux systems
  • Download Qt online installer for Linux 64-bit from developers site.
  • Run installer from the command line, then follow the instructions.
$ chmod u+x qt-opensource-linux-x64-1.6.0-7-online.run
$ ./qt-opensource-linux-x64-1.6.0-7-online.run
  • Note, that the name of installer package may differ
  • By default Qt will be installed in the directory /home/yourname/Qt
  • Specify the following variables in your .bashrc file
$ export QTDIR=/home/yourname/Qt/5.7/gcc_64
$ export PATH=$QTDIR/bin:$PATH
$ export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
  • You have to adjust QTDIR variable for the Qt version number and yourname to point to the right Qt directory.
Open new terminal and validate that qmake --version command gives you the right Qt version you have just installed:
> Using Qt version 5.7.0 in /home/yourname/Qt/5.7/gcc_64/lib