【问题标题】:Header conflict error with mingw32 (ogre3d+cegui+glm application)mingw32 的标头冲突错误(ogre3d+cegui+glm 应用程序)
【发布时间】:2015-05-05 20:47:56
【问题描述】:

由于升级后的库现在使用 glm,我正在升级 ogre 应用程序以使用较新版本的 ogre,并且在使用 mingw 在 Windows 上编译它时遇到了一些问题。

在编译时我遇到了一些这样的错误:

In file included from c:\mingw\bin../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:\Users\jacob\Documents\git\ThriveDirectReview2\src\engine\engine.cpp:8:
c:\mingw\bin../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:\Users\jacob\Documents\git\ThriveDirectReview2\src\engine\engine.cpp:21:

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

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

所以 ogre(图形库)使用 gcc 的 xmmintrin 头文件,而 cegui(为 ogre 构建的 gui 库)也使用 gcc 的 intrin.h,这两个头文件定义了几乎相同的接口并导致冲突。

所有相关的源代码都可以在这里找到: 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 但他们无法提供帮助。

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

编辑:发现两个 *intrin 文件都来自 gcc。

【问题讨论】:

    标签: c++ mingw glm-math ogre ogre3d


    【解决方案1】:

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

    2 天内无法接受我自己的答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-19
      • 1970-01-01
      相关资源
      最近更新 更多