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. Can't use built in SQLite functions after building SQLite plugin in Qt 6.5.1

Can't use built in SQLite functions after building SQLite plugin in Qt 6.5.1

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 290 Views
  • 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.
  • I Offline
    I Offline
    ioki9
    wrote on last edited by
    #1

    Hi, I need to use built in SQLite hook function. For this purpose i've built SQLite plugin for my prebuilt Qt that I got from online installer. I have tried the following from what Qt docs suggests:

    1. Downloaded SQLite 3.42.0 source (amalgamation) and windows binaries from offcial site
    2. Compiled binaries into sqlite3.lib via CMD for VS 2017 with: "lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x64"
    3. configured via Qt 6.5.1 CMD with command: "qt-cmake -G Ninja C:\Qt\6.5.1\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=C:\Qt\6.5.1\mingw_64 -DCMAKE_INCLUDE_PATH=C:\libs\sqlite-amalgamation-3420000 -DCMAKE_LIBRARY_PATH=C:\libs\sqlite-amalgamation-3420000 -DFEATURE_system_sqlite=ON". All sqlite3 files (binaries and .c/.h) were in sqlite-amalgamation-3420000 folder.
    4. cmake --build .
    5. cmake --install .
    6. Using sqlite header file in my project tried to call a function which gives me error of undefined reference.

    Have I built it wrong way or am I using it incorecctly?
    I would appreciate any help. Thanks in advance.

    Christian EhrlicherC 1 Reply Last reply
    0
    • I ioki9

      @Christian-Ehrlicher So basically I can't use built in SQLite functions and Qt SQL in the same project?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #4

      You can as explained in the documentation but you have to link against the exact same sqlite library and it must not be compiled statically into the plugin but a separate sqlite dll.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      I 1 Reply Last reply
      2
      • I ioki9

        Hi, I need to use built in SQLite hook function. For this purpose i've built SQLite plugin for my prebuilt Qt that I got from online installer. I have tried the following from what Qt docs suggests:

        1. Downloaded SQLite 3.42.0 source (amalgamation) and windows binaries from offcial site
        2. Compiled binaries into sqlite3.lib via CMD for VS 2017 with: "lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x64"
        3. configured via Qt 6.5.1 CMD with command: "qt-cmake -G Ninja C:\Qt\6.5.1\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=C:\Qt\6.5.1\mingw_64 -DCMAKE_INCLUDE_PATH=C:\libs\sqlite-amalgamation-3420000 -DCMAKE_LIBRARY_PATH=C:\libs\sqlite-amalgamation-3420000 -DFEATURE_system_sqlite=ON". All sqlite3 files (binaries and .c/.h) were in sqlite-amalgamation-3420000 folder.
        4. cmake --build .
        5. cmake --install .
        6. Using sqlite header file in my project tried to call a function which gives me error of undefined reference.

        Have I built it wrong way or am I using it incorecctly?
        I would appreciate any help. Thanks in advance.

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @ioki9 said in Can't use built in SQLite functions after building SQLite plugin in Qt 6.5.1:

        Using sqlite header file in my project tried to call a function which gives me error of undefined reference.

        I would not expect anything else since the sqlite functions are in a Qt sql plugin and not exported anywhere.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        I 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @ioki9 said in Can't use built in SQLite functions after building SQLite plugin in Qt 6.5.1:

          Using sqlite header file in my project tried to call a function which gives me error of undefined reference.

          I would not expect anything else since the sqlite functions are in a Qt sql plugin and not exported anywhere.

          I Offline
          I Offline
          ioki9
          wrote on last edited by
          #3

          @Christian-Ehrlicher So basically I can't use built in SQLite functions and Qt SQL in the same project?

          Christian EhrlicherC 1 Reply Last reply
          0
          • I ioki9

            @Christian-Ehrlicher So basically I can't use built in SQLite functions and Qt SQL in the same project?

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #4

            You can as explained in the documentation but you have to link against the exact same sqlite library and it must not be compiled statically into the plugin but a separate sqlite dll.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            I 1 Reply Last reply
            2
            • Christian EhrlicherC Christian Ehrlicher

              You can as explained in the documentation but you have to link against the exact same sqlite library and it must not be compiled statically into the plugin but a separate sqlite dll.

              I Offline
              I Offline
              ioki9
              wrote on last edited by
              #5

              @Christian-Ehrlicher I thought that linking to Qt SQLite was enough after rebuilding plugin and using header. It worked after I linked to the initial library I was building Qt plugin from. Thanks for your help!

              Christian EhrlicherC 1 Reply Last reply
              0
              • I ioki9 has marked this topic as solved on
              • I ioki9

                @Christian-Ehrlicher I thought that linking to Qt SQLite was enough after rebuilding plugin and using header. It worked after I linked to the initial library I was building Qt plugin from. Thanks for your help!

                Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @ioki9 said in Can't use built in SQLite functions after building SQLite plugin in Qt 6.5.1:

                I thought that linking to Qt SQLite was enough after rebuilding plugin and using header.

                It can't - it does not export the sqlite functions in any way (why should it).

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1

                • Login

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