有人曾經這樣做過嗎?用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一起工作嗎?
如果您花時間回答,請提前致謝。