View Full Version : Building MySQL QT Drivers on Windows XP

12th August 2010, 11:05
Goodmorning to all,
I'm a newbie of QT Framework and I would use it with MySQL.
I read documentation about building of MySQL driver (I've 2010.04 Qt Version). It show how it is possibile build this driver by the mysql.pro project, by mean of qmake command or QtCreator. I've tried to run the Build command by QTCreator and, hiding the warning I got these result. 5061.

So I've tried to link the mysql.h header of MySQL, and run Build; I got these errors.5062

I've tried to use qmake command from QT shell, or using the procedure with reimp command to create manually the libmysql.dll but no way.

Have you got any ideas?

I'm on Windows XP SP3. Peraphs miss some environment variables?

Thanks for your time.


12th August 2010, 11:28
First I would do that on a console ("cmd" on windows) not in the creator. Since your path to the mysql header contains white space you have to use $$quote() in your qmake file. Are you using MinGW or MSVS?

12th August 2010, 13:56
I'm using MinGW. The path is correct because from the first image and the last, the error relative to the mysql.h disappared. I've used other times this sintax and the library are correctly linked. But... how use $$Quote? $$quote("C:\....")? or only near the part $$quote("MySQL Server 5.1")?

how can I catch all result of qmake command from cmd? I can see only the last part :(

Thanks for your time.


12th August 2010, 14:14
Here is a great description on how to build the plugin. Try this: http://www.lemon-factory.com/2010/04/24/qt-building-the-mysql-plugin-on-windows/

And quote is to use with the whole path: $$quote("C:\....")

12th August 2010, 17:04
:((( No way :((
I've tried the procedure definited by the link you suggest (thanks for this link) but no way. The make command return 2 errors, but i can't see the complete verbose result of building :( How I can put these result in a file and analyze them after building process? Now I can see only one part of these ones.

Thanks for your time.


14th August 2010, 05:51
I've made it work a couple days ago:

1º download mysql essentials fron mysql site.
2º install everything on C:\MYSQL or some path like this, so you wont get headaches about spaces in paths
3º build the plugin exactly as this guide (http://www.qtcentre.org/wiki/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW) says
4º add in your .pro file in the QT section the string "sql" (without quotes)

do exactly that and you should be ready to go! :cool:

ah... btw, on the guide, ignore the "MinGW tips" section

16th August 2010, 18:54
For the record, the guide from knifesk is also the one I used a month or so ago. However, to be fair, it is essentially the same as the one posted by Lykurg, at least to my newbish mind.