Пытаюсь собрать плагин для MySQL и получаю ошибку
Последние версии MySQL официально не поддерживают сборку под MinGW и соответственно нужной вам библиотеки, в соответствующем формате в поставке нет. Придется сделать ее самому. Примерно так:
This is a small HOWTO, explaining on how to convert the MySQL libraries
to something which is usable with MinGW.
1) Go to the MySQL lib directory:
   # cd <path_where_mysql_is_installed>\lib\opt
2) Produce a DEF file:
   # pexports libmysql.dll | sed "s/^_//" > libmysql.def
   *NOTE: pexports and sed come with MinGW utilities and msys.
3) Create the MinGW import library:
   # dlltool -U -d libmysql.def -l libmysql.lib.a
At this moment, a MinGW compatible library libmysql.lib.a is created.
But, the headers are still written this way they are using the M$
calling convention. We need to change this.
4) Open the header <path_where_mysql_is_installed>\include\mysql.h
   and change the following around line 44:
   Change:
   #define STDCALL __stdcall
   into:
   #undef  STDCALL
   #define STDCALL
*NOTE: The following is more a hack instead of a solution.
       Maybe you can come up with a cleaner patch.
       Use some extra #ifdef's or something ...
Now, we will build the Qt MySQL plugin using MinGW.
5) Go to the Qt MySQL plugin source directory:
   # cd <path_where_qt_is_installed>\src\plugins\sqldrivers\mysql
6) Launch qmake to generate the Makefile
   # qmake -o Makefile 
"INCLUDEPATH+=<path_where_mysql_is_installed>\include"
     "LIBS+=-L<path_where_mysql_is_installed>\lib\opt" mysql.pro
7) Build the plugin
   # make
PS: I have tried the above for MySQL 4.1 (4.1.12a) and OpenSource Win32 Qt4.
Данный способ был обнаружен на каком-то буржуйском форуме и принадлежит некоему Bert Wizzy. Сам этим пользовался. Работает. Но от MySQL теперь уже, по разным причинам, отказались, в пользу Postgre.