At the moment, Cygwin can only build a static version of
MySQL++. The practical upshot of this is that Cygwin can
only be used to build LGPL or GPL-licensed MySQL++ programs.
Unless you're one of the few that have a commercial Cygwin
license, you are already under this restriction because
your programs must be GPL-licensed in this case anyway.
(See http://www.redhat.com/software/cygwin/ for details.)
If your program is under some other license and you do not
have a commercial Cygwin license, you must use Visual C++.
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:
Prerequisite: Build MySQL
Before you can build MySQL++, you need to build the MySQL
client library from source. This is necessary because
Cygwin programs work best when linked to Cygwin libraries.
You do not need to build a Cygwin version of the MySQL server;
it's still best to use the native Win32 version of that.
The MySQL client library does not build correctly out of
the box. The best instructions I've found covering the
necessary changes are here:
I recommend that you use MySQL v4.1.x at this time. Skip the
step changing the pthread stuff in my_thr_init.c, as this
change has already been made in recent versions of MySQL.
With the changes applied, build and install the client library
$ autoreconf --install --verbose --force
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--infodir=/usr/share/info --mandir=/usr/share/man \
$ make install
Building the Library and Example Programs
Now that the MySQL client library is built and installed,
you can build MySQL++. The only trick is that you have to
pass the proper flag to the configure script to make it build
a static version of MySQL++ only.
The simplest set of commands for this is:
$ ./configure --disable-shared
$ make install
For more on configure script options, see README.unix.