Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
No SQL driver available
I try to use SQLITE in my project.
In QMAKE I add:
QT += core gui sql opengl
But when I check availabele drivers by typing:
QStringList driverNmaeList = QSqlDatabase::drivers();
I get empty string list. How to add SQLITE? Do I need explicitly add SqLite library to the project?
Windows 10, Qt 5.14.2, MSVC 2017
ChrisW67 last edited by
How did you obtain and install Qt? Is this condition on your development box or in a deployed environment?
No, you do not need to explicitly add source files from sqlite to your project. The Qt sqlite plugin has sqlite built in, but this plugin needs to be present. It should be present in the ...\plugins\sqldrivers\ directory or either your development copy of Qt5 or your deployed application's folder structure.
@ChrisW67 yes I have those drivers in the folder. I installed Qt in standard way: I downloaded Qt installer from Qt web site.
Probably I need to set some environment vars?
QTDIR = C:\Qt\5.14.2\msvc2017_64
Please_Help_me_D last edited by Please_Help_me_D
@ChrisW67 I just found that Qt can't see SQL drivers only in my current project. In any test project I can see them.
According to this I can supplement the question:
My current project contains two subprojects:
Both subprojects include
QT += sqlbut
coreI compile to the shared library. So
main.cppand it doesn't have
QApplication a(argc, argv);. My
QApplication a(argc, argv);.
May that be a reason?
@ChrisW67 I simply did full rebuild (clean project, deleted built folder, run QMAKE, build) and it worked!
Thank you for help.
Pablo J. Rogina last edited by
and it worked!
great, so please don't forget to mark you post as solved!