Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED]Connecting to database in Static build
As I know static build preventing using database plug-in drivers.
Is there any way to make my application connecting to the database with static build?
Have a look at the "plugin":http://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins documentation
[quote author="SGaist" date="1366196645"]Hi,
Have a look at the "plugin":http://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins documentation[/quote]
I added the plugins as mentioned above during configuration process:
[code]./configure -static -developer-build -v -qt-sql-psql -qt-sql-sqlite -plugin-sql-psql -plugin-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -qt-xcb[/code]
I'm using Qt 5.0.2
Code_ReaQtor last edited by
Plugin works with "shared/dll" builds. However, if you built Qt from source in "static" mode, you may still connect to a database - database plugins will be added to QtSql.lib/QtSqld.lib (I think).
There is also another option, use "QSqlDatabase::registerSqlDriver":http://qt-project.org/doc/qt-4.8/qsqldatabase.html#registerSqlDriver if you have a custom Sql Driver. I wrote a "blog":http://qtsimplify.blogspot.com/ on that thing 2 days ago if you need a reference.
You can find a similar document for Qt5
Did you update the pro file and your code to make use of the plugins you need ?
Sorry guys.. my mistake I forgot to add the following to my .pro file
[code]QTPLUGIN += qsqlpsql[/code]