MySQL Forums
Forum List  »  Source, Builds, Binaries

mingw port of mysql connector c and c++
Posted by: Martin Trautmann
Date: June 30, 2011 02:01AM

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.

Options: ReplyQuote


Subject
Views
Written By
Posted
mingw port of mysql connector c and c++
20715
June 30, 2011 02:01AM
2498
September 18, 2011 07:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.