[Qt-interest] configuring Qt with MySQL
Jaime Fernandez
j.fernandez at midimesures.fr
Wed May 13 22:42:24 CEST 2009
Hello,
You can try this :
-> run configure with the plugin version instead of the builtin driver
version (just replace "-qt-sql-mysql" by "-plugin-sql-mysql").
-> edit the .pro file which will be use to built your plugin driver
(sorry, I can't remember his name right now).
-> in this file, add to the INCLUDE and LIB item thes paths to the header
and lib files of mysql (the ones you've already used for configure).
-> then run nmake.
-> provide the plugin and your code will have mysql support.
This trick has worked for me (Qt4.5.0-VS2008-Vista) but I'm still looking
for a solution with the mysql driver builtin within my Qt libraty.
Regards,
> Hi,
>
> I have been trying to get Qt to work with MySQL without any luck. When I
> run
> a 2 line test code, it comes back with a message saying- "This application
> has failed to start because LIBMYSQL.DLL was not found. Re-installing the
> application may fix this problem". Can anyone please guide me on fixing
> the
> issue and getting MySQL to work with Qt?
>
> Here's what I have done so far-
>
> 1) I downloaded and installed MySQL 5.1.34 using the installer(
> mysql-5.1.34-win32.msi) from MySQL website.
> 2) I downloaded the latest opensource Qt
> sources(qt-win-opensource-src-4.5.1) from Qt website and configured it as
> follows:
> a) added the path to locate qmake etc.
> b). configure -debug-and-release -l libmysql -I
> D:\MySQL\MySQLServer5.1\include -L D:\MySQL\MySQLServer5.1\lib\opt
> -qt-sql-mysql -qt-sql-odbc
> c) nmake
>
> These steps went fine but when I run the test code, it doesn't work. The
> code that I was trying to run is :
> ------
> #include <QCoreApplication>
> #include <QSqlDatabase>
> #include <QStringList>
> #include <QtDebug>
>
> int main( int argc, char **argv )
> {
> QCoreApplication app( argc, argv );
> qDebug() << QSqlDatabase::drivers();
> }
>
> ------
>
> Can anyone please help me fix the issues here?
>
> Thanks,
> Ashish
> <http://www.qtcentre.org/forum/editpost.php?do=editpost&p=102755>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list