Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building SQL driver plugin

Building SQL driver plugin

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 5 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sajeevan K
    wrote on last edited by
    #1

    Hi,

    I want to implement an export to MS Excel application.
    For that I want to enable ODBC in Qt.
    I am testing it in an Ubuntu 16.04 laptop.
    For this I am following the guide : https://doc.qt.io/qt-5/sql-driver.html
    I downloaded the qt source - https://download.qt.io/official_releases/qt/5.10/5.10.1/si ngle/qt-everywhere-src-5.10.1.tar.xz
    And downloaded odbc driver plugin unixODBC-2.3.7 from http://www.unixodbc.org/.
    As per the guide, when I execute the command "qmake -- ODBC_PREFIX=/usr/local/unixODBC", it is showing the errors:

    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:8: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:9: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:10: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:11: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:12: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:13: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:14: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:15: Unknown test function: qtConfig
    qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:16: Unknown test function: qtConfig

    Is there any work around to solve this issue?

    S 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Use the full path to the qmake executable for the version of Qt you want to build the plugin for.

      Currently you are using the qmake version from your distribution which likely is from a Qt 4 development package.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        Sajeevan K
        wrote on last edited by
        #3

        Thank You very much SGaist. Using the qt5 qmake full path obtained from the source qt-everywhere-src-5.10.1, solved the issue.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sajeevan K
          wrote on last edited by
          #4

          Hi,
          Now I could build sql odbc driver plugin successfully, and the library binary file libqsqlodbc.so is created in the folder - qt-everywhere-src-5.10.1/qtbase/plugins/sqldrivers.

          And I copied the same .so file in ~/QtCreatorInstall/Tools/QtCreator/lib/Qt/plugins/sqldrivers.

          I could build a qt example project - tablemodel - successfully in QtCreator.

          But when I am running it is giving an error -

          QSqlDatabase: QODBC driver not loaded
          QSqlDatabase: available drivers:

          Any clues?

          jsulmJ 1 Reply Last reply
          0
          • S Sajeevan K

            Hi,
            Now I could build sql odbc driver plugin successfully, and the library binary file libqsqlodbc.so is created in the folder - qt-everywhere-src-5.10.1/qtbase/plugins/sqldrivers.

            And I copied the same .so file in ~/QtCreatorInstall/Tools/QtCreator/lib/Qt/plugins/sqldrivers.

            I could build a qt example project - tablemodel - successfully in QtCreator.

            But when I am running it is giving an error -

            QSqlDatabase: QODBC driver not loaded
            QSqlDatabase: available drivers:

            Any clues?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Sajeevan-K Why do you copy the driver into QtCreator installation directory?
            You should put it into your Qt installation plugins/sqldrivers

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • S Offline
              S Offline
              Sajeevan K
              wrote on last edited by
              #6

              Hi jsulm,

              Thank You very much. Copying libqsqlodbc.so to qt installation plugins folder /usr/local/Qt-5.10.1/plugins/ solved the issue.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                gnc20
                Banned
                wrote on last edited by gnc20
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • S Sajeevan K

                  Hi,

                  I want to implement an export to MS Excel application.
                  For that I want to enable ODBC in Qt.
                  I am testing it in an Ubuntu 16.04 laptop.
                  For this I am following the guide : https://doc.qt.io/qt-5/sql-driver.html
                  I downloaded the qt source - https://download.qt.io/official_releases/qt/5.10/5.10.1/si ngle/qt-everywhere-src-5.10.1.tar.xz
                  And downloaded odbc driver plugin unixODBC-2.3.7 from http://www.unixodbc.org/.
                  As per the guide, when I execute the command "qmake -- ODBC_PREFIX=/usr/local/unixODBC", it is showing the errors:

                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:8: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:9: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:10: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:11: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:12: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:13: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:14: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:15: Unknown test function: qtConfig
                  qt-everywhere-src-5.10.1/qtbase/src/plugins/sqldrivers/sqldrivers.pro:16: Unknown test function: qtConfig

                  Is there any work around to solve this issue?

                  S Offline
                  S Offline
                  samantha2
                  Banned
                  wrote on last edited by samantha2
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved