2008-10-07 27 views
0

問題之間的衝突是編譯器說有屬於MySQL的圖書館和文件math.h從STD庫之間的功能的重新定義。問題與MySQL和MATH.H

我一直在這兩天,我仍然無法弄清楚。

這已經發生過任何人嗎?

這是輸出從編譯器提前


 
C:\mingw\bin\mingw32-make.exe all 
'Building file: ../src/interfaz/ventanaconf.cpp' 
'Invoking: GCC C++ Compiler' 
C:\mingw\bin\mingw32-g++.exe -mms-bitfields -I"c:\dev-cpp\gtkmm\include\gtkmm-2.4" 
-I"c:\dev-cpp\gtkmm\lib\gtkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\glibmm-2.4" 
-I"c:\dev-cpp\gtkmm\lib\glibmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\gdkmm-2.4" 
-I"c:\dev-cpp\gtkmm\lib\gdkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\pangomm-1.4" 
-I"c:\dev-cpp\gtkmm\include\atkmm-1.6" -I"c:\dev-cpp\gtkmm\include\sigc++-2.0" 
-I"c:\dev-cpp\gtkmm\lib\sigc++-2.0\include" -I"c:\dev-cpp\gtkmm\include\cairomm-1.0" 
-I"c:\gtk\include\gtk-2.0" 
-I"c:\gtk\include\glib-2.0" 
-I"c:\gtk\lib\glib-2.0\include" 
-I"c:\gtk\lib\gtk-2.0\include" 
-I"c:\gtk\include\pango-1.0" 
-I"c:\gtk\include\cairo" 
-I"c:\gtk\include\freetype2" 
-I"c:\gtk\include" 
-I"c:\gtk\include\atk-1.0" 
-I"c:\Archivos de programa\MySQL\MySQL Server 5.0\include" 
-O0 -g3 -w -c -fmessage-length=0 -MMD -MP -MF"src/interfaz/ventanaconf.d" 
-MT"src/interfaz/ventanaconf.d" 
-o"src/interfaz/ventanaconf.o" "../src/interfaz/ventanaconf.cpp" 
In file included from c:/Archivos de programa/MySQL/MySQL Server 5.0/include/my_global.h:73, 
       from ../src/interfaz/../gestiondb/gestordb.h:6, 
       from ../src/interfaz/../gestiondb/operacionesdb.h:5, 
       from ../src/interfaz/ventanamodulos.h:20, 
       from ../src/interfaz/ventanaconf.h:27, 
       from ../src/interfaz/ventanaconf.cpp:1: 
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h: **In function `double rint(double)': 
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h:228: error: redefinition of `double rint(double)' 
C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:620: **error: `double rint(double)' previously defined here** 
C:\mingw\bin\mingw32-make.exe: *** [src/interfaz/ventanaconf.o] Error 1** 

謝謝!

回答

1

的問題是關於包含的庫,哪個Linux簡單地忽略,但Windows想出來的。這是沒有問題讓出來,在linux既不...

唸叨着我覺得SOOOOOOOOOOOOOOOOOOOOOOO STUPID:..

0

在第228行的c:\ Program Files \ MySQL \ MySQL Server 5.0/include/config-win.h中,您應該找到名爲「rint」的函數聲明/定義。在C:/ mingw/bin /../ lib/gcc/mingw32/3.4.2 /../../../../include/math.h的第620行中,你應該找到函數的另一個定義相同的名字(這可能甚至是相同的)。

爲了解決你將不得不刪除/ outcomment /取消定義,這些定義中的一個問題。

準備鏈接時得到了類似的問題,如果你還連接兩個庫具有相同的功能。

2

This thread在MySQL支持領域似乎表明,他們已經將rint()的定義從今年4月份的config_win.h文件中取出(即使該補丁是在2006年提出的)。您是否使用比此更新版本的MySQL源代碼?

+0

我只是嘗試這種解決方案,是不工作...我採用的是MySQL的一箇舊realese,但5.0.51,但是在下載5.0.67的源代碼後,我得到了相同的結果。 – 2008-10-07 16:46:08