I build the QMYSQL drivers, but when I run my program this error appears:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers:
Here is path to were my so files has been compiled :
/home/uia53314/Qt5.13.0/5.13.0/Src/qtbase/src/plugins/sqldrivers/plugins/sqldrivers
ls :
libqsqlite.so libqsqlite.so.debug libqsqlmysql.so libqsqlmysql.so.debug
/Qt5.13.0/5.13.0/Src/qtbase/src/plugins/sqldrivers$ ls:
config.cache libqsqlite.so psql
config.log libqsqlite.so.debug qsqldriverbase.pri
config.opt libqsqlmysql.so qtsqldrivers-config.h
config.summary libqsqlmysql.so.debug qtsqldrivers-config_p.h
config.tests Makefile qtsqldrivers-config.pri
configure.json mkspecs README
configure.pri mysql sqldrivers.pro
db2 oci sqlite
ibase odbc sqlite2
lib plugins tds
Running the qmake sqldrivers.pro in /Qt5.13.0/5.13.0/Src/qtbase/src/plugins/sqldrivers give me :
Configure summary:
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. yes
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/home/uia53314/Qt5.13.0/5.13.0/gcc_64'.
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
Is something that I need to add in my profile to make the program see the drivers :
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
QT += core gui charts sql
TARGET = WebmPlayer
TEMPLATE = app
CONFIG += c++11
QTPLUGIN += qsqlmysql
DEFINES += QT_DEPRECATED_WARNINGS
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
TEMPLATE = app
INCLUDEPATH += /usr/local/include/
LIBS += -L/usr/local/lib -lcurlpp -lcurl
LIBS += -L/usr/local/lib/x86_64-linux-gnu -lmysqlclient
CONFIG += console link_pkgconfig
#CONFIG -= app_bundle qt
PKGCONFIG += vpx opus vorbis
INCLUDEPATH = . libwebm
DEPENDPATH = . libwebm