How to Build the QSQLITE Plugin
-
@tmfjr if your issue is solved, please don't forget to mark your post as such!
-
@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.
-
@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.
-
@tmfjr
What's yourconfig.logsaying?
And what do you have in ${SQL_DIR}/include and ${SQL_DIR}/lib?@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 functionpthreadMutexAlloc': see-sqlite3.c:(.text+0x3e32): undefined reference topthread_mutexattr_init'
see-sqlite3.c:(.text+0x3e43): undefined reference topthread_mutexattr_settype' see-sqlite3.c:(.text+0x3e62): undefined reference topthread_mutexattr_destroy'
/data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In functionpthreadMutexTry': see-sqlite3.c:(.text+0x3f17): undefined reference topthread_mutex_trylock'
/data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In functionsqlite3ThreadCreate': see-sqlite3.c:(.text+0x7e0b): undefined reference topthread_create'
/data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In functionsqlite3ThreadJoin': see-sqlite3.c:(.text+0x7ea0): undefined reference topthread_join'
/data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In functionunixDlOpen': see-sqlite3.c:(.text+0xf680): undefined reference todlopen'
/data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In functionunixDlError': see-sqlite3.c:(.text+0xf69f): undefined reference todlerror'
/data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In functionunixDlSym': see-sqlite3.c:(.text+0xf6ee): undefined reference todlsym'
/data/DEPS_ROOT/SQLite/lib/libsqlite3.a(see-sqlite3.o): In functionunixDlClose': see-sqlite3.c:(.text+0xf724): undefined reference todlclose'
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:67: sqlite3] Error 1
=> source failed verification. -
Hi,
Does your custom SQLite library have dependencies ?
Are the missing symbols coming from them ? -
Hi,
Does your custom SQLite library have dependencies ?
Are the missing symbols coming from them ?@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 -
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. -
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.@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-sqlitein the configure command rather than-system-sqliteand, whileconfigurecompleted 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
configurecommand 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.
-
@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-sqlitein the configure command rather than-system-sqliteand, whileconfigurecompleted 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
configurecommand 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.