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).