Currently, MinGW can only build a static version of MySQL++.
Legally speaking, this means that you can only use MySQL++ in
programs with LGPL-compatible license. This wouldn't be the
case if we could get MinGW to build a DLL version of MySQL++.
The effort to make it build a DLL has stalled due to lack
of interest from the major maintainers. We will, however,
accept patches if someone manages to get it working.
If you are not willing to contribute to that effort, I
recommend that you switch to Visual C++, which builds a DLL
version of MySQL++ without fuss. (And no, you cannot link a
Visual C++ DLL containing C++ code to a MinGW program; only
C DLLs are compatible across toolchains.)
If the cost is the only thing keeping you from using
Visual C++, there are free versions of VC++ available.
See the Visual C++ item in the MySQL++ FAQ for details:
Building the Library and Example Programs
First, you will need to create a MinGW-compatible import
library. Assuming you installed MySQL in c:\mysql and MySQL++
in c\mysql++, the commands to do this are:
dlltool -k -d c:\mysql++\libmysqlclient.def -l libmysqlclient.a
To configure the MySQL++ library to build with MinGW, say
"makemake mingw" in the project's root directory. If you
change the Makefile.base or Makefile.mingw files, you will
have to run makemake again.
Now you can build the library with the command "mingw32-make".
That command ensures that you're using the MinGW version
of GNU make, and not some other version. In particular,
the Cygwin and MSYS versions of GNU make WILL NOT WORK.
This problem is not insurmountable; if you want to fix it,
see Makefile.vc files, which work around differences among
these versions of GNU make. Please send a patch for this to
the mailing list if you do it.
If you didn't install MySQL in c:\mysql, you will have to
change Makefile.mingw in the lib and examples subdirectories
and re-run "makemake mingw". You may also look at changing
these files for various other reasons, such as if you don't
like the way we name the DLL file. If you want to change
the install location, that is in install.bat.