PDA

View Full Version : problems building the QMYSQL plugin on Windows 64 using MinGW 64



carpanta
24th April 2012, 10:59
Hello everybody,




I tried to follow this guide: http://www.qtcentre.org/wiki/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW

and the first problem comes when the path folder seems different from the usual, coz mine is

C:\QtSDK\QtCreator with bin, libe and share folders inside.

and in that guide and googling usually I found

%QTDIR%/src/plugins/sqldrivers/mysql.

I found in this path on my computer the sqldrivers folder

C:\QtSDK\QtCreator\bin\sqldrivers

and I dont know how to build the Qmysql driver running this command

cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
nmake

I have located my libmysql.lib here

C:\xampp\mysql\lib\libmysql.lib



Some help please, thx in advance

qlands
24th April 2012, 20:13
Hi,

I am assuming that you have QT SDK for Windows 64 bits and mysql for 64 bits

1. Put in your path environmental variable the qt bin and MinGW bin directories. This is accessible with properties of my computer --> advanced tab --> environmental variables (you need to be admin). For example: ;C:\Qt\2010.03\qt\bin;C:\Qt\2010.03\mingw\bin

2. run cmd (the command line terminal)
3. cd into the mysql plugin. For example: cd C:\Qt\2010.03\qt\src\plugins\sqldrivers\mysql
4. run the following command substituting the path to where your mysql is (replace the C:\mysql\mysql-5.5.23-win32\ to where your mysql is) :



qmake mysql.pro INCLUDEPATH+=C:\mysql\mysql-5.5.23-win32\include LIBS+=C:\mysql\mysql-5.5.23-win32\lib\libmysql.lib


5. run mingw64-make

After this you will have the new mysql plugin in [QT directory]\plugins\sqldrivers.

Carlos.