I am having real problem with compiling MySQL libraries for Qt in Windows and Mac. Essentially, I cannot use mysql with a Qt application because of missing the file QMYSQL. I am pretty much new when it comes to configure and install applications in Unix-like systems. However, building libraries for Qt looks like this. I have read a little bit about GNU C and GNU Make to understand what is done but it is still overwhelming me.
The guide in Qt Project says I should have folder include and lib/opt in which I should have libmysql.lib file. There’s no such folder like opt/ but there is the file libmysql.lib and libmysql.dll in /lib folder. Qt Project website does not say that but I have copied everything to C:/QtSDK/QtSources/4.8.1/src/plugins/sqldriver/mysql where I also found mysql.pro. I run this command:
qmake "INCLUDEPATHS+=include" "LIB+=libmysql.lib" mysql.pro
and the program generated a Makefile for me. When I run “make”, or “make release” etc. make stops always at the same point and states there is no “mysql.lib” file. I cannot find this file anywhere.
Does anybody has any idea how to do it? Please, at least direct me where I could start looking.
The following has worked for me: Unfortunately, I had to install the whole Qt(v 4.8.2) from sources. I strongly recommend it. It has a huge impact on your experience, although it may sometimes be a real pain.
I have:
built makefile by calling configure with following parameters:
and finally
mingw32-make.exe
Special attention should be on
-platform win32-g++4.6if MinGW 4.6.x+ is used. It did not seem to work when I used
-platform win32-g++etc. I hope it will help the others to build MySql libraries for Qt.