0

问题是编译器说在属于 MySQL 的库和 std 库中的 math.h 之间有一个函数的重新定义。

我已经解决了两天了,我仍然无法弄清楚。

这曾经发生在任何人身上吗?

这是编译器的输出


C:\mingw\bin\mingw32-make.exe 全部
'构建文件:../src/interfaz/ventanaconf.cpp'
'调用:GCC C++ 编译器'
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"
在 c:/Archivos de programa/MySQL/MySQL Server 5.0/include/my_global.h:73 包含的文件中,
                 来自../src/interfaz/../gestiondb/gestordb.h:6,
                 来自../src/interfaz/../gestiondb/operacionesdb.h:5,
                 来自../src/interfaz/ventanamodulos.h:20,
                 来自../src/interfaz/ventanaconf.h:27,
                 来自../src/interfaz/ventanaconf.cpp:1:
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h: **在函数`double rint(double)'中:
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h:228: 错误:重新定义`double rint(double)'
C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:620: **错误: `double rint(double) ' 之前在这里定义过**
C:\mingw\bin\mingw32-make.exe: *** [src/interfaz/ventanaconf.o] 错误 1**

提前致谢!!!

4

3 回答 3

2

mysql 支持区域中的这个线程似乎表明他们已经从今年 4 月的 config_win.h 文件中删除了 rint() 的定义(即使该补丁是在 2006 年提出的)。您使用的 MySQL 源版本是否比该版本更新?

于 2008-10-07T16:15:19.947 回答
1

问题是关于一个包含的库,linux 简单地忽略了它,但 windows 想要退出。在linux中放出来也没问题...

有时候我觉得 SOOOOOOOOOOOOOOOOOOOOOOO 愚蠢:..

于 2009-02-10T11:01:33.243 回答
0

在 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 行中,您应该找到另一个函数定义相同的名称(甚至可能相同)。

要解决该问题,您必须删除/取消注释/取消定义这些定义之一。

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

于 2008-10-07T16:08:09.807 回答