PDA

View Full Version : Qt4 win opensource + mysql plugin



vr
24th May 2007, 19:07
Hi,

today I installed qt4.2.3 opensource + mingw on windows xp sp2 computer. After installation i built the mysql plugin as usually (currently i'm using qt+mingw+mysql plugin on my office pc and also my laptop).
The plugin compiled and built successfully, and the plugin dll is placed in the $QTDIR\plugins\sqldrivers directory.
After building the plugin i normally check the plugin availability with sql browser example.
This time i noticed the only available drivers are the "builtin" ones: odbc and sqlite.
Qt doesn't detect and load the plugin.

I did a few plugin rebuilt, qt reinstall, in different combinations but the result is always the same...

Any idea or solution?

vr

patrik08
25th May 2007, 08:27
Hi,
I did a few plugin rebuilt, qt reinstall, in different combinations but the result is always the same...
vr

I use Mingw compiler e QT3-4 from 2 years a go ... i never successful build mysql driver after qt installation...

I integrate mysql lib to Mingw lib && include dir and run perfect...
and QtSql4.dll go to 737 KB :)




mysql lib dir ....
reimp -d libmysql.lib
dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a
dlltool --input-def libmysql.def --dllname libmysql.dll --output-lib c:\MINGW\lib\libmysql.a
/* move mysql include to MINGW\include\*/
/*
cd qtdir
configure -qt-sql-mysql -qt-sql-odbc -qt-sql-sqlite -qt-gif -qt-libpng -qt-libjpeg

*/

vr
25th May 2007, 08:53
Very funny,

i do almost the same:
reimp -d libmysql.lib
dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a

and than in $qtdir\src\plugins\sqldrivers\mysql
qmake -o Makefile "INCLUDEPATH+=C:\MYSQL\INCLUDE" "LIBS+=-LC:\MYSQL\LIB\OPT -lmysql" mysql.pro
make

and it always worked till now. This time i used the latest mysql version 5.0.41. Maybe it's "too fresh"?

I'll check your solution!
Bye

patrik08
25th May 2007, 09:01
Very funny,
and it always worked till now. This time i used the latest mysql version 5.0.41. Maybe it's "too fresh"?
I'll check your solution!
Bye

Now you can read it on wiki...
http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW