I start to use Windows-targeted variant GCC (http://gcc.gnu.org/) - MinGW (http://www.mingw.org/) to make application with using MySQL client in C environment.
So
http://dev.mysql.com/doc/mysql/en/c-api-functions.html is main guide.
Before under FreeBSD I have no problem with linking MySQL library standard way:
gcc -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm -L/usr/lib -lssl -lcrypto -o application application.c
#include "/usr/local/include/mysql/mysql.h"
MYSQL ConnectionHandle; MYSQL_RES *Resource; MYSQL_ROW Row;
int main (int argc, char **argv) {
mysql_real_connect (&ConnectionHandle, ...
All is OK.
But this time, in Windows environment:
#include "C:\Program Files\MySQL\MySQL Server 4.1\include\mysql.h"
C:\MinGW\bin\gcc.exe -mconsole -I"C:\Program Files\MySQL\MySQL Server 4.1\include" -L"C:\Program Files\MySQL\MySQL Server 4.1\lib\opt" -lmysqlclient -lm -o application.exe application.c
produces huge number "C:/MinGW/include/mysql.h:687: parse error before '*' token"
In fact it's missed way to get compile C-sourced application with MySQL client library.
Headers, library and other binaries is for Windows platform, of course.
So, how to fix it?