Using sqlite with a static build of Qt 5.9.4 in MSVC2017
-
wrote on 13 Aug 2018, 09:04 last edited by
Hi,
I am currently in the process of migrating a legacy application to Qt 5.9.4 which uses SQlite.
I have compiled a static version of Qt 5.9.4 with the new "--sql-sqlite" option, which generated a qsqlite.lib plugin in sqldrivers.
If I link this library the application produces an error (QSQLITE driver not loaded). If I insert
Q_IMPORT_PLUGIN(qsqlite)
into my application I get a linker error:
LNK2001 Unresolved symbol "struct QStaticPlugin const __cdecl qt_static_plugin_qsqlite(void)" (?qt_static_plugin_qsqlite@@YA?BUQStaticPlugin@@XZ)".
Is there anything else I need to be doing? We are using the Qt Visual Studio Tools (so no qmake .pro file).
Is it not possible to integrate sqlite in to static core directly (as was previously possible wit "--qt-sqlite" iirc)?
-
wrote on 13 Aug 2018, 09:24 last edited by
Ok, I think the correct import is:
Q_IMPORT_PLUGIN(QSQLiteDriverPlugin)
Is this documented somewhere (to make sure)?
-
Hi and welcome to devnet,
It's explained in the Plugins Howto in Qt's documentation.
-
wrote on 14 Aug 2018, 06:16 last edited by
Hi, thanks for your reply.
The article you linked does cover the use of static plugins but only in a qmake-environment (which I don't use). Also I could not find any reference to the actual plugin name (QSQLiteDriverPlugin) yet.
-
Hi, thanks for your reply.
The article you linked does cover the use of static plugins but only in a qmake-environment (which I don't use). Also I could not find any reference to the actual plugin name (QSQLiteDriverPlugin) yet.
What you can do is create a project using qmake that uses everything you need for your other application then inspect the generated visual studio project for the informations you need.
1/5