Have someone ever done this before???
I am trying to use MinGW to compile a program using the MySQL libraries. I keep getting the message that the function 'rint' is redefined. Ok it's true that the function is in both files config-win.h, from MySQL and math.h from the standard library, but both of them are suppose to be libraries with no problems.
After breaking my head a while i tried even this, that wont compile:
#include <iostream>
#include <my_global.h>
#include <mysql.h>
using namespace std;
int main() {
cout << "Hello World!!!" << endl; // prints Hello World!!!
return 0;
}
And this is the command as well as the output i issue for compiling
i586-mingw32msvc-cc -I/usr/include/mysql probando.cpp -w
In file included from /usr/include/mysql/my_global.h:73,
from probando.cpp:10:
/usr/include/mysql/config-win.h: In function ‘double rint(double)’:
/usr/include/mysql/config-win.h:229: error: redefinition of ‘double rint(double)’
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:635: error: ‘double rint(double)’ previously defined here
I have tested it both in WindowsXP with MinGW, with the MySQL libraries properly transformed in .a libraries and in Linux (the output is from Linux, pretty much the same than in Windows) with MinGW32.
People... I am running out of options... Any clues?? Has someone worked before with MySQL and MinGW?? May it work with Cygwin??
Thanks in advance if you take the time to answer.