【问题标题】:Compiling with Ogre + MFC in _DEBUG mode在 _DEBUG 模式下使用 Ogre + MFC 编译
【发布时间】:2010-11-01 00:31:40
【问题描述】:

在调试模式下使用 MFC 编译 Ogre 时出现问题,由于 MFC 宏而出现错误:

#ifdef _DEBUG #define new DEBUG_NEW

这基本上破坏了 Ogre 的新调试 -

#define OGRE_NEW new (__FILE__, __LINE__, __FUNCTION__)

我试图让 MFC+Ogre 在 DEBUG 模式下一起愉快地运行,我得到了它的编译:

#ifdef _DEBUG #undef 新 #万一 Ogre::Root * root = OGRE_NEW Ogre::Root( pluginsFile, "ogre.cfg", "Ogre.log" ); #ifdef _DEBUG #define new DEBUG_NEW #万一

但是现在,我得到一个运行时错误:Ogre::InternalErrorException

还有其他人面临/解决这个问题吗?

【问题讨论】:

    标签: c++ mfc


    【解决方案1】:

    您可能需要删除 MFC 调试宏而不是 Ogre。在 Ogre Wiki 上查看这篇标题为 Common Mistakes Ogre Wiki

    的文章

    【讨论】:

    • 嗯。这个我知道,但是我希望编译运行,让Ogre使用它的内存分配函数,让MFC使用它自己的内存分配函数
    • 也许我可以尝试模拟你的场景,看看我得到了什么
    【解决方案2】:

    我认为这可能是我使用的特定机器的问题。我在另一台机器上试过了,它似乎在调试模式下使用 #ifdefs #undefs 工作,如上所示。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多