Linux Mint Source Coding Qt5.8
Introduction
After Qt5.5, the official Qt has no 32-bit installation package for Linux system. The development environment requires 32-bit Qt to be installed only through source code compilation. The system is 32-bit Linux Mint with Qt5.8 installed
Compile and install process
Download source code
Source Download Website: http://download.qt.io/archive/qt/
All versions of Qt installation packages and source code are available. I downloaded qt-everywhere-opensource-src-5.8.0.tar.gz.
To configure
After decompressing and entering the source directory, configure compilation options
View Help Documents
$ cat README
The official help document is not very clear, but it gives a link to compile Qt5 from git, and the instructions are very detailed.
# Building Qt5 from git See http://wiki.qt.io/Building_Qt_5_from_Git and README.git for more information. See http://wiki.qt.io/Qt_5 for the reference platforms.
Installation of required tools
$ sudo apt-get install build-essential perl python
Install xcb Libraries
$ sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
Install Multimedia Library
$ sudo apt-get install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
Additional installation is required if you need to use the libraries of WebEngine and WebKit
$ sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby
$ sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libdbus-1-dev libfontconfig1-dev libcap-dev libxtst-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libxss-dev libegl1-mesa-dev gperf bison
configuration option
$ .\configure -confirm-license -opensource -prefix $PWD\qtbase -release -nomake tests -nomake examples -skip qtmacextras -skip qtandroidextras
-
- confirm-license-opensource uses open source protocols
-
- prefix Specifies Installation Directory
-
- release Install release Version
-
- nomake tests-nomake examples do not install test and sample modules
-
- Skp can skip some source modules for compilation, and here I skip apparently unused Apple and Android modules.
Compile source code
You can compile a base package first
$ make -j4 module-qtbase
After successful compilation, compile all
$ make -j4 Long time, compiled with 4 threads
install
$ sudo make install
Configuring Qt paths
Terminal command open
$ sudo vim /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf
32-bit system
$ sudo vim /usr/lib/i386-linux-gnu/qt-default/qtchooser/default.conf
Change the first line to the bin path of the Qt installation directory, and the second line to the Qt installation path.
/home/dkw/qt-everywhere-opensource-src-5.8.0/qtbase/bin /home/dkw/qt-everywhere-opensource-src-5.8.0/qtbase
Install qtCreator
After entering the source directory
$ qmake -r $ make -j4 $ sudo make install INSTALL_ROOT=$INSTALL_DIRECTORY //INSTALL_DIRECTORY is your installation directory