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. How to Build the QSQLITE Plugin
Qt 6.11 is out! See what's new in the release blog

How to Build the QSQLITE Plugin

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 6 Posters 3.9k Views 3 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.
  • Pablo J. RoginaP Pablo J. Rogina

    @tmfjr if your issue is solved, please don't forget to mark your post as such!

    T Offline
    T Offline
    tmfjr
    wrote on last edited by
    #11

    @Pablo-J-Rogina It looks like it it not solved. Although it compiles without error, it is not using the version of SQLite I provide. In the build log, there is no -I or -L path to my version of SQLite.

    B 1 Reply Last reply
    0
    • T tmfjr

      @Pablo-J-Rogina It looks like it it not solved. Although it compiles without error, it is not using the version of SQLite I provide. In the build log, there is no -I or -L path to my version of SQLite.

      B Offline
      B Offline
      Bonnie
      wrote on last edited by
      #12

      @tmfjr
      I think you was right to use "-system-sqlite", maybe try to add that back?

      T 1 Reply Last reply
      1
      • B Bonnie

        @tmfjr
        I think you was right to use "-system-sqlite", maybe try to add that back?

        T Offline
        T Offline
        tmfjr
        wrote on last edited by
        #13

        @Bonnie I tried adding it back, but I get this:

        ERROR: Feature 'system-sqlite' was enabled, but the pre-condition 'features.sql-sqlite && libs.sqlite3' failed.

        B 1 Reply Last reply
        0
        • T tmfjr

          @Bonnie I tried adding it back, but I get this:

          ERROR: Feature 'system-sqlite' was enabled, but the pre-condition 'features.sql-sqlite && libs.sqlite3' failed.

          B Offline
          B Offline
          Bonnie
          wrote on last edited by Bonnie
          #14

          @tmfjr
          What's your config.log saying?
          And what do you have in ${SQL_DIR}/include and ${SQL_DIR}/lib?

          T 1 Reply Last reply
          0
          • B Bonnie

            @tmfjr
            What's your config.log saying?
            And what do you have in ${SQL_DIR}/include and ${SQL_DIR}/lib?

            T Offline
            T Offline
            tmfjr
            wrote on last edited by
            #15

            @Bonnie It looks like it is finding the library, but seems to not like that it is static.

            • cd /data/Qt/5.14.2/Src/config.tests/sqlite3 && MAKEFLAGS= /opt/rh/devtoolset-8/root/usr/bin/gmake

            g++ -c -pipe -O2 -w -fPIC -I. -I/data/DEPS_ROOT/SQLite/include -I/data/Qt/5.14.2/Src/qtbase/mkspecs/linux-g++ -o main.o main.cpp
            g++ -Wl,-O1 -o sqlite3 main.o -L/data/DEPS_ROOT/SQLite/lib -lsqlite3 -lz
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function pthreadMutexAlloc': see-sqlite3.c:(.text+0x3e32): undefined reference to pthread_mutexattr_init'
            see-sqlite3.c:(.text+0x3e43): undefined reference to pthread_mutexattr_settype' see-sqlite3.c:(.text+0x3e62): undefined reference to pthread_mutexattr_destroy'
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function pthreadMutexTry': see-sqlite3.c:(.text+0x3f17): undefined reference to pthread_mutex_trylock'
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function sqlite3ThreadCreate': see-sqlite3.c:(.text+0x7e0b): undefined reference to pthread_create'
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function sqlite3ThreadJoin': see-sqlite3.c:(.text+0x7ea0): undefined reference to pthread_join'
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function unixDlOpen': see-sqlite3.c:(.text+0xf680): undefined reference to dlopen'
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function unixDlError': see-sqlite3.c:(.text+0xf69f): undefined reference to dlerror'
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function unixDlSym': see-sqlite3.c:(.text+0xf6ee): undefined reference to dlsym'
            /data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In function unixDlClose': see-sqlite3.c:(.text+0xf724): undefined reference to dlclose'
            collect2: error: ld returned 1 exit status
            gmake: *** [Makefile:67: sqlite3] Error 1
            => source failed verification.

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

              Hi,

              Does your custom SQLite library have dependencies ?
              Are the missing symbols coming from them ?

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

              T 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                Does your custom SQLite library have dependencies ?
                Are the missing symbols coming from them ?

                T Offline
                T Offline
                tmfjr
                wrote on last edited by
                #17

                @SGaist It seems all dependent libraries need to be listed when configuring. Instead of following the instructions noted initially, which are incorrect, I configured like this:

                ./configure -I ${SQL_DIR}/include -L ${SQL_DIR}/lib -system-sqlite SQLITE_PREFIX=${SQL_DIR} SQLITE_INCDIR=${SQL_DIR}/include SQLITE_LIBDIR=${SQL_DIR}/lib SQLITE_LIBS="-lsqlite3 -lpthread -ldl" -prefix /data/Qt_build

                This got me past the configure errors. Some of this may be redundant, but my config.log is now clean.

                g++ -c -pipe -O2 -w -fPIC -I. -I/data/DEPS_ROOT/SQLite/include -I/data/DEPS_ROOT/SQLite/include -I/data/DEPS_ROOT/SQLite/include -I/data/Qt/5.14.2/Src/qtbase/mkspecs/linux-g++ -o main.o main.cpp

                g++ -Wl,-O1 -o sqlite3 main.o -L/data/DEPS_ROOT/SQLite/lib -lsqlite3 -lpthread -ldl -lz
                => source accepted.
                test config.qtbase_sqldrivers.libraries.sqlite3 succeeded

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

                  The tripled include statement looks like overkill in the test :-D
                  But other than than that, yes, you need to list everything that is used and not "hidden" in the implementation itself.

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

                  A 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    The tripled include statement looks like overkill in the test :-D
                    But other than than that, yes, you need to list everything that is used and not "hidden" in the implementation itself.

                    A Offline
                    A Offline
                    AMGAMG
                    wrote on last edited by AMGAMG
                    #19

                    @SGaist: I've read this thread as I'm trying to do exactly the same - i.e. build a SQLite driver using the encryption extension.

                    I have downloaded the sources for sqlite into a directory and defined %SQLITE_DIR% to point to it.

                    I am having a problem with configure.

                    With this configure command:

                    CALL configure -prefix %CD%\qtbase -nomake tests -nomake examples -system-sqlite -opensource -confirm-license SQLITE_PREFIX=%SQLITE_DIR%
                    

                    I see this error, from configure:

                    Project ERROR: Unknown feature object datestring in expression 'features.datestring && libs.odbc'.
                    

                    Before reading this thread, I had -sql-sqlite in the configure command rather than -system-sqlite and, while configure completed successfully, I later saw the same error when I executed qmake.

                    I appreciate that I have omitted several arguments that @tmfr had included on the configure command and I expect to have to tackle them once I've got configure to complete successfully once more.

                    I can't see anything helpful in config.log. In particular it does not include any reference to datestring. How should I continue?

                    Apologies

                    The above transcript comes from a run where I executed configure ... -sql-sqlite.... I know this is wrong. I still have errors with configure ... -system-sqlite ... but I will try to resolve them myself before posting any further questions.

                    SGaistS 1 Reply Last reply
                    0
                    • A AMGAMG

                      @SGaist: I've read this thread as I'm trying to do exactly the same - i.e. build a SQLite driver using the encryption extension.

                      I have downloaded the sources for sqlite into a directory and defined %SQLITE_DIR% to point to it.

                      I am having a problem with configure.

                      With this configure command:

                      CALL configure -prefix %CD%\qtbase -nomake tests -nomake examples -system-sqlite -opensource -confirm-license SQLITE_PREFIX=%SQLITE_DIR%
                      

                      I see this error, from configure:

                      Project ERROR: Unknown feature object datestring in expression 'features.datestring && libs.odbc'.
                      

                      Before reading this thread, I had -sql-sqlite in the configure command rather than -system-sqlite and, while configure completed successfully, I later saw the same error when I executed qmake.

                      I appreciate that I have omitted several arguments that @tmfr had included on the configure command and I expect to have to tackle them once I've got configure to complete successfully once more.

                      I can't see anything helpful in config.log. In particular it does not include any reference to datestring. How should I continue?

                      Apologies

                      The above transcript comes from a run where I executed configure ... -sql-sqlite.... I know this is wrong. I still have errors with configure ... -system-sqlite ... but I will try to resolve them myself before posting any further questions.

                      SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #20

                      @AMGAMG there's no need to rebuild all of Qt only to build one of the SQL plugins. There are instructions in the documentation for that.

                      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
                      0

                      • Login

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