PDA

View Full Version : QMYSQL available but not loaded ?



davidovv
11th December 2012, 19:34
First to say, maybe i am too much ahead using qt5 rc1 (it just got out)... anyway here is the problem
Short version:
application gives me folowing error when connecting to database

QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3

How can this be?

Long version:
Development machine is ubuntu 12.04 x64, After a lot of trouble i managed to compile mysql driver and to connect to mysql database: it works fine
Deployment machine is lubuntu 12.04 x64, since there is no repostiory support yet for qt5 i copied some of files and folders from development machine
(platforms, sqldrivers) into the folder with application, set LD_LIBRARY_PATH variable, The application starts but with the worning, and there is no connection to mysql database.

Can someone help me troubleshoot this strange situation, or to point to steps how to properly deploy qt application on linux manualy?

//-----------------------------------

I managed to solve my problem
http://www.qtcentre.org/wiki/index.php?title=Deploying_Qt_Applications
Here is a nice explanation here how linking works on this forum (i wish i saw this before i mysqlf (with google help) came with solution with LD_LIBRARY PATH
/*i mistyped myself but i typed mysql so many times theese days that i decidet to leave mysqlf */
The tool that saved the day was ldd
i just executed ldd on libsqlmysql.so driver and there were some dependencies missing

I also got another simmilar error
Failed to load platform plugin "xcb". Available platforms are:
linuxfb
minimal
xcb

that had same dependancy problems
ldd on libxcb.so found them

can i say thanks to mysqlf?
:)