Menu
Active5 years, 6 months ago
I am trying to load psql on qt without success. My code:
Hi All, I'm trying to make a program that inserts a record into a database. I can't connect to the database. I get the following error: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL. Jun 13, 2018 I have the following code that produces these results: ('QSQLITE', 'QMYSQL', 'QMYSQL3') QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: Stack Overflow. Log In Sign Up. QMYSQL driver available but not loaded. Available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7. Qt5.2 can find the mysql driver but can not load. Sep 29, 2019 QSqlDatabase: QMYSQL3 driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 Il semblerait que le load du driver ne puisse se faire. Faut-il adapter un PATH pour XUBUNTU ou pour QT ou.
I have QT_DEBUG_PLUGINS enabled. Output is:
'The plugin 'C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)' not a plugin QFactoryLoader::QFactoryLoader() looking at 'C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll' Got keys from plugin meta data ('QPSQL7', 'QPSQL') QFactoryLoader::QFactoryLoader() checking directory path 'C:/build-Hello-Desktop_Qt_5_1_1_MinGW_32bit-Debug/debug/sqldrivers' ... loaded library 'C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll' QLibraryPrivate::loadPlugin failed on 'C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll' : 'Cannot load library C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll: The specified module could not be found.' QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7
My configuration:
I have run dependency walker for the libpg.dll. Two missing dependencies:
- GPSVC.DLL
- IESHIMS.DLL
It seems that after these steps my effort is going to less organised 'just-try-something...'.
icodebuster8,66477 gold badges5555 silver badges6161 bronze badges
JuhhiJuhhi
3 Answers
The first error message more or less tells everything:
The plugin 'C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)'
I suppose your program is compiled in debug mode, but you are missing Qt plugins, which where compiled in debug mode. How this happened, since you said you used are ready made package... No idea.
Qmysql Driver Not Loaded
Try to compile your program in release mode. In .pro:
GreenflowGreenflowCONFIG+=release
.3,58622 gold badges1111 silver badges2626 bronze badges
Had the same problem. It is usually the fact that you're using 32-bit Qt with 64-bit Postgresql. I downloaded the 32-bit postgresql, changed the path(in Qt creator) to the 32-bit postgre libraries and everything worked flawlessly.
Using: Qt 5.2.0, 32bit (from SDK)PostgreSQL 9.3(x86)
ZanyinjZanyinj1,50711 gold badge99 silver badges66 bronze badges
dehborisdehboris