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
Forum Updated to NodeBB v4.3 + New Features

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 298 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 27 Jul 2023, 03:49 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.

    C 1 Reply Last reply 27 Jul 2023, 04:39
    0
    • I ioki9
      27 Jul 2023, 04:43

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

      C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 27 Jul 2023, 04:45 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 29 Jul 2023, 09:07
      2
      • I ioki9
        27 Jul 2023, 03:49

        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.

        C Online
        C Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 27 Jul 2023, 04:39 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 27 Jul 2023, 04:43
        0
        • C Christian Ehrlicher
          27 Jul 2023, 04:39

          @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 27 Jul 2023, 04:43 last edited by
          #3

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

          C 1 Reply Last reply 27 Jul 2023, 04:45
          0
          • I ioki9
            27 Jul 2023, 04:43

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

            C Online
            C Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 27 Jul 2023, 04:45 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 29 Jul 2023, 09:07
            2
            • C Christian Ehrlicher
              27 Jul 2023, 04:45

              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 29 Jul 2023, 09:07 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!

              C 1 Reply Last reply 29 Jul 2023, 09:33
              0
              • I ioki9 has marked this topic as solved on 29 Jul 2023, 09:07
              • I ioki9
                29 Jul 2023, 09:07

                @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!

                C Online
                C Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 29 Jul 2023, 09:33 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

                4/6

                27 Jul 2023, 04:45

                • Login

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