【问题标题】:Assert when including boost mutex header file in MFC dll在 MFC dll 中包含 boost mutex 头文件时断言
【发布时间】:2017-07-28 20:55:53
【问题描述】:

我有 boost 1_57 的标头版本。我想在我的代码中使用 object_pool 的功能。 但是我看到,如果我只是将此头文件包含到使用我的 mfc dll 项目编译的任何 .cpp 文件中,那么当我在调试模式下运行使用此 dll 的程序时,dllinit.cpp 中有一个断言:

void AFXAPI AfxCoreInitModule()
{
    ASSERT(AfxGetModuleState() != AfxGetAppModuleState());
    ...
}

我看到标头也包含并且包含在我的 cpp 文件中也会导致该断言。

【问题讨论】:

    标签: c++ boost dll mfc assert


    【解决方案1】:

    这似乎是 Boost 中的一个问题(与 MFC 不兼容),在 _pRawDllMain 处理中。

    请参阅此处了解可能的解决方案:http://boost.2283326.n4.nabble.com/Fwd-Thread-Solution-to-conflict-with-MFC-td3477977.html

    【讨论】:

      猜你喜欢
      • 2011-12-10
      • 2012-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多