MINGW32(OGRE3D CEGUI GLM应用程序)的标题冲突错误

Header conflict error with mingw32 (ogre3d+cegui+glm application)

本文关键字:标题 冲突 错误 应用程序 OGRE3D CEGUI GLM MINGW32      更新时间:2023-10-16

我正在将OGRE应用程序升级到使用较新版本的OGRE中,并且由于现在使用GLM升级的库,已在Windows上遇到了一些问题,并在Windows上汇编了此问题。。

编译时,我会遇到许多错误:

In file included from c:mingwbin../lib/gcc/i686-w64-mingw32/4.7.3/include/xmmintrin.h:36:0,
from C:/mingw/OgreSDK/include/OGRE/OgreCommon.h:35,
from C:/mingw/OgreSDK/include/OGRE/OgreMath.h:34,
from D:/Users/jacob/Documents/git/ThriveDirectReview2/src/engine/serialization.h:7,
from D:UsersjacobDocumentsgitThriveDirectReview2srcengineengine.cpp:8:
c:mingwbin../lib/gcc/i686-w64-mingw32/4.7.3/include/mmintrin.h:53:1: error: previous declaration of 'void _m_empty()' with 'C++' linkage
In file included from C:/mingw/install/include/glm/core/setup.hpp:549:0,
from C:/mingw/install/include/glm/glm.hpp:89,
from C:/mingw/install/include/cegui-9999/CEGUI/../CEGUI/Size.h:37,
from C:/mingw/install/include/cegui-9999/CEGUI/../CEGUI/Rect.h:33,
from C:/mingw/install/include/cegui-9999/CEGUI/../CEGUI/Image.h:33,
from C:/mingw/install/include/cegui-9999/CEGUI/../CEGUI/BitmapImage.h:30,
from C:/mingw/install/include/cegui-9999/CEGUI/../CEGUI/CEGUI.h:37,
from D:UsersjacobDocumentsgitThriveDirectReview2srcengineengine.cpp:21:

查看/glm/core/setup.hpp:549:0我们有:

if defined(MINGW32) && (GLM_ARCH != GLM_ARCH_PURE)
include intrin.h
endif

so ogre(图形库)使用GCC的XMMINTRIN标头,CEGUI(为Ogre构建的GUI库)也使用Intrin.h也来自GCC,这两个标头都定义了几乎相同的接口并引起冲突。

所有相关源代码都可以在此处找到:https://github.com/revolutionary-games/thrive/tree/ogre2.0

因此,GLM似乎与GCC不相容,这对我来说似乎很奇怪。更令人惊讶的是Cegui不与Ogre合作,所以我的第一步是在CEGUI论坛上发布:http://cegui.org.uk/forum/viewtopic.php?f=10&t=7024,但他们是他们我们无法提供帮助。

这似乎是一个非常专业的问题,也许对于堆栈溢出来说太专业了,但我希望您可以提供帮助,或者为解决问题的方向提供建议!

编辑:发现两个 *intin文件均来自GCC。

似乎这是一个旧的GCC错误:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56038

不能接受我自己的答案2天。