有人曾经这样做过吗?用C++编译用mysql,pthreads和gtk
我想用MinGW编译使用MySQL库的程序。我不断收到函数'rint'被重新定义的消息。好的,这个函数的确在函数中都是来自MySQL的config-win.h文件和来自标准库的math.h文件,但是它们都是假设没有问题的库。
#include <iostream>
#include <my_global.h>
#include <mysql.h>
using namespace std;
int main() {
cout << "Hello World!!!" << endl; // prints Hello World!!!
return 0;
}
这是命令以及输出我发出编译
i586的-mingw32msvc-CC:
打破我的头,即使这同时我想,这不会编译后-I的/ usr /包括/ 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
我已经在WindowsXP使用MinGW测试它二者,与MySQL库prope使用MinGW32在.a库和Linux(输出来自Linux,几乎与Windows相同)中转换。
人们......我缺少选择......任何线索?有人曾与MySQL和MinGW工作?它可以与Cygwin一起工作吗?
如果您花时间回答,请提前致谢。