Installing Qt 5.7 on openSUSE Leap 42.1
Download the latest version of Qt in Linux:
wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
Making the file executable
chmod +x qt-unified-linux-x64-online.run
Install gcc, make, and other necessary libraries:
sudo zypper install --type pattern devel_basis
Next, install the Qt:
./qt-unified-linux-x64-online.run
Follow the instructions of the graphical installer. Do not forget to select the item of the Source code libraries.
Building IBASE SQL driver
To build the driver must be installed firebird development packages. If they are not installed, then the following command to install these packages must be performed.
sudo zypper in libfbclient2-devel
Then go to the directory with the source ibase drivers that are in the driver Qt sql folder.
cd <QtPath>/5.7/Src/qtbase/src/plugins/sqldrivers/ibase
Then edit the include file of project, because otherwise the building will be errors about missing libraries.
vi ../../../sql/drivers/ibase/qsql_ibase.pri
We look for the line
!contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
and change it to the next
!contains(LIBS, .*gds.*):!contains(LIBS, .*lfb.*):LIBS += -lgds
After that, compile and install driver
<QtPath>/Qt/5.7/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/firebird" "LIBS+=-L/usr/lib64 -lfbclient" ibase.pro make make install
Checking the installed drivers
To check the drivers installed, you can create a console project Qt, PRO-file in which you must specify the following Qt modules:
QT += core sql
main.cpp
ontent main.cpp file will be as follows:
#include <QCoreApplication> #include <QtSql> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qDebug() << "Доступные драйверы:" << QSqlDatabase::drivers(); return a.exec(); }
Output
The output qDebug() obtain information about the available drivers, including the driver must be QIBASE.
Доступные драйверы: ("QIBASE", "QSQLITE", "QMYSQL", "QMYSQL3", "QPSQL", "QPSQL7")