Eclipse + Mingw is a great build environment but the hurdles to access mysql connector c and c++ are quite high despite several useful comments of how to setup the binary versions.
I took a different route and modified the source code to work with mingw. Mostly it was sufficient to add the correct behavior if WIN32 and __MINGW32__ is defined.
https://sourceforge.net/projects/windiana.u/files/mysql/port-mingw/
Compiling cmake with mingw worked fine for me:
1) download and extract
http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
2) run "./configure"
3) run "make"
4) run "make install" <== this needs priviledges to write to Program Files folder
5) include CMake directory in PATH
Compiling the mysql connector c:
1) extract mysql-connector-c-6.0.2.mingw-port.tgz
2) run "cmake -G 'MSYS Makefiles'"
3) run "make"
4) run "make install"
5) include libmysql directory in PATH to use mysql_config for building your application or for building mysql connector c++
Compiling mysql connector c++ works analogous to mysql connector c except that mysql_config needs to be in PATH for the configuration to work.
Technical details:
Regarding the BIG_ENDIAN check of cmake I did not find a good way of making it optional. So feel free to make proposals of how to improve the patch possibly for later inclusion into the main source code. Getting mysql_config right for english versions of Windows with a space in "C:\Program Files" is quite tricky. I hope that I got this right but comments/suggestions are welcome.
Edited 2 time(s). Last edit at 06/30/2011 07:50AM by Martin Trautmann.