MySQL Forums
Forum List  »  Connector/C++

Re: Using MinGW with MySQL on Windows
Posted by: Pitch Over
Date: January 02, 2010 03:12AM

please ignore my previous post, the problem relies on the mysql-test.c (sample) not the mysql library.

MinGW, MySQL, C, GTK+ work smoothly on my windows xp now :)

Here's my brief summary:

download mysql-connector-c-noinstall-6.0.2-win32.zip from http://mysql.com
extract it to MinGW root directory
copy /lib/libmysql.dll to your working source directory (optional)

WARNING: include <winsock.h> at the 1st line of your source code

1. pexports libmysql.dll > libmysql.def
2. dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a
4. gcc test.c -o test -L . -lmysql

Edit libmysql.def
- replace mysql_init w/ mysql_init@4
(*) repeat this step for all mysql functions you'll plan to use.
(*) you'll notice the @* from gcc error ouput (step 4)

- repeat step 2 above (rerun dlltool).

Options: ReplyQuote


Subject
Views
Written By
Posted
6219
December 12, 2009 01:27PM
4615
January 01, 2010 02:19PM
Re: Using MinGW with MySQL on Windows
13701
January 02, 2010 03:12AM


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.