Evgenii Legotckoi
Aug. 25, 2016, 9:04 p.m.

Qt/C++ - Lesson 053. Building IBASE SQL driver Qt 5.7 on openSUSE Leap 42.1

Installing Qt 5.7 on openSUSE Leap 42.1

Download the latest version of Qt in Linux:

  1. wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run

Making the file executable

  1. chmod +x qt-unified-linux-x64-online.run

Install gcc, make, and other necessary libraries:

  1. sudo zypper install --type pattern devel_basis

Next, install the Qt:

  1. ./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.

  1. sudo zypper in libfbclient2-devel

Then go to the directory with the source ibase drivers that are in the driver Qt sql folder.

  1. 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.

  1. vi ../../../sql/drivers/ibase/qsql_ibase.pri

We look for the line

  1. !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds

and change it to the next

  1. !contains(LIBS, .*gds.*):!contains(LIBS, .*lfb.*):LIBS += -lgds

After that, compile and install driver

  1. <QtPath>/Qt/5.7/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/firebird" "LIBS+=-L/usr/lib64 -lfbclient" ibase.pro
  2. make
  3. 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:

  1. QT += core sql

main.cpp

ontent main.cpp file will be as follows:

  1. #include <QCoreApplication>
  2. #include <QtSql>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QCoreApplication a(argc, argv);
  7. qDebug() << "Доступные драйверы:" << QSqlDatabase::drivers();
  8.  
  9. return a.exec();
  10. }

Output

The output qDebug() obtain information about the available drivers, including the driver must be QIBASE.

  1. Доступные драйверы: ("QIBASE", "QSQLITE", "QMYSQL", "QMYSQL3", "QPSQL", "QPSQL7")

Do you like it? Share on social networks!

Comments

Only authorized users can post comments.
Please, Log in or Sign up
  • Last comments
  • Evgenii Legotckoi
    March 9, 2025, 9:02 p.m.
    К сожалению, я этого подсказать не могу, поскольку у меня нет необходимости в обходе блокировок и т.д. Поэтому я и не задавался решением этой проблемы. Ну выглядит так, что вам действитель…
  • VP
    March 9, 2025, 4:14 p.m.
    Здравствуйте! Я устанавливал Qt6 из исходников а также Qt Creator по отдельности. Все компоненты, связанные с разработкой для Android, установлены. Кроме одного... Когда пытаюсь скомпилиров…
  • ИМ
    Nov. 22, 2024, 9:51 p.m.
    Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
  • Evgenii Legotckoi
    Oct. 31, 2024, 11:37 p.m.
    Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
  • A
    Oct. 19, 2024, 5:19 p.m.
    Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html