问题是编译器说在属于MySQL的库和std库中的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**

提前致谢!!!

有帮助吗?

解决方案 2

问题是关于一个包含的库,linux只是忽略了,但是Windows想要了。毫无疑问在Linux中出现它......

总有一天我感觉如此超自然:..

其他提示

在mysql支持区域中此主题似乎表明他们'从截至今年4月开始,他们从config_win.h文件中取出了rint()的定义(即使该补丁是在2006年提出的)。你使用的MySQL版本比那个更新吗?

在c:/ Archivos de programa / MySQL / MySQL Server 5.0 / include / config-win.h的第228行,你应该找到名为“rint”的函数的声明/定义。在C:/ mingw / bin /../ lib / gcc / mingw32 / 3.4.2 /../../../../ include / math.h的第620行,你应该找到一个函数的另一个定义相同的名字(甚至可能是相同的)。

要解决此问题,您必须删除/取消注释/取消定义其中一个定义。

如果您还链接两个具有相同功能的库,请准备好在链接时遇到类似的问题。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top