2008-10-07 54 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