Solved NO QSqlDatabase drivers in Release
-
I'm working with Qt 5.12.3 in Visual Studio 2017 64bit.
I'm having a strange error. A simple output:
qDebug << QSqlDatabase::drivers();
In Debug mode it prints:
QSLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
If I run it in Release (CTRL+F5) it prints an empty list ().
I checked in Project Linker Input and Qt5Sql.lib is setted, so why I get an empy list?EDIT: I just tested that code in QT Creator, Debug and Release show the same list, there is something wrong with my VS project
-
@TheEnigmist probably the needed DLLs cannot be found on runtime, or wrong (incompatible) versions are found and cannot be used.
-
@aha_1980
I checked QApplication::libraryPaths() and added qt sql dlls there, but still it print empty list. But only in release, in debug it work like a charm -
Hi,
The plugins have a hierarchy to follow. You can see it in your Qt installation. You can also use windeployqt to see which one goes where for your application.
-
Seems that "Qt Project Settings" hasn't been edited correctly, I checked and unchecked SQL and now it works... weird...