PDA

View Full Version : MySql driver problem



stilgar
10th April 2010, 15:17
Hello,
I've a problem with MySql database driver.
My Qt version is 4.5.2 Commercial and my OS is Windows 7 Ultimate Ed.

First of all I want to say that I already completed the procedure to build MySql plugin manually as reported in Qt Documentation. In fact now I can see qsqlmysql4.dll and qsqlmysqld4.dll libraries in $(QTDIR)\plugins\sqldrivers folder.

My problem is I m not able to load MySql driver only in release version.
If I try to load the libraries manually through the command



QLibrary mysqlLib("qsqlmysql4");

int ret = mysqlLib.load();


The value of varibale ret is 1 as I expected. Both in release and debug version.

After doing it, if I try to control if the driver is available like that:



if (QSqlDatabase::isDriverAvailable ("QMYSQL") == false)
{
QMessageBox box;
box.setText("Error: driver QMYSQL not available\n");
box.exec();
}



I got the Message Box with the Error message only in release mode.
I don't understand why.
Somebody can help me?

Thank you

aliks-os
13th April 2010, 11:26
Put libmysql.dll into the folder Release