I built qt with -plugin-sql-mysql -plugin-sql-sqlite flags. I have libqsqlmysql.a and libqsqlite.a. I use qt in my project. But my build system is not qt, I use waf.
I have the following problem when I try to run my application which establishes connection with mysql database:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers:
QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins
INFO - Failed to connect to root mysql admin
I added -lqsqlmysql to compiler options when I build the app.
Can you please explain how qt drivers work, how and when it tries to load driver. What is a qt driver (dll, lib, ….)?
I think your app is trying to load the database plugin dynamically, from a DLL. This document will help you find the appropriate location for the database driver DLL. Alternatively, you could link your app against the plugin statically, here’s how.