mysql和math.h之间的冲突问题

mysql和math.h之间的冲突问题,mysql,math.h,Mysql,Math.h,问题是编译器说在属于MySQL的库和std库中的math.h之间有一个函数的重新定义 这件事我已经讨论了两天了,但我还是不明白 这曾经发生在任何人身上吗 这是编译器的输出 C:\mingw\bin\mingw32-make.exe全部 '构建文件:../src/interfaz/ventanaconf.cpp' 调用:GCC C++编译器 C:\mingw\bin\mingw32-g++.exe-mms位域-I“C:\dev cpp\gtkmm\include\gtkmm-2.4” -I“c:

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

这件事我已经讨论了两天了,但我还是不明白

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

这是编译器的输出


C:\mingw\bin\mingw32-make.exe全部 '构建文件:../src/interfaz/ventanaconf.cpp' 调用:GCC C++编译器 C:\mingw\bin\mingw32-g++.exe-mms位域-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-F消息长度=0-MMD-MP-MF“src/interfaz/ventanacof.d” -MT“src/interfaz/VENTANACOF.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 programma/MySQL/MySQL Server 5.0/include/config win.h:*在函数'double rint(double')中: c:/Archivos de programma/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**

提前感谢

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

要解决此问题,您必须删除/outcomment/undefine其中一个定义


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

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

要解决此问题,您必须删除/outcomment/undefine其中一个定义


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

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

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

问题在于包含了一个库,linux只是忽略了这个库,但windows想要退出。在linux中发布它也没有问题


有时候我觉得自己太傻了:…

问题在于一个包含的库,linux只是忽略了它,但windows想要退出。在linux中发布它也没有问题


有时我觉得自己很愚蠢:…

我只是尝试了这个解决方案,但没有效果。。。我使用的是MySQL的旧版本,但是5.0.51,但是在下载了5.0.67的源代码之后,我得到了相同的版本。我认为问题在于config win.h是为实现rint()而设计的,因为大多数Windows机器都有错误的舍入行为。但是,看起来您使用的是mingw/gcc,因此您的rint()与任何*nix系统都相同。。。不确定如何解决问题。我只是尝试了此解决方案,但不起作用。。。我使用的是MySQL的旧版本,但是5.0.51,但是在下载了5.0.67的源代码之后,我得到了相同的版本。我认为问题在于config win.h是为实现rint()而设计的,因为大多数Windows机器都有错误的舍入行为。但是,看起来您使用的是mingw/gcc,因此您的rint()与任何*nix系统都相同。。。不确定如何解决该问题。 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**