【问题标题】:Error C1189 MFC错误 C1189 MFC
【发布时间】:2014-11-29 14:05:14
【问题描述】:

我已经在网上搜索过解决方案,但没有任何帮助。 我想用 C++ 编写一个简单的聊天,一切都很好,但我得到了这个错误:

错误 C1189:#error:使用 /MD[d](CRT dll 版本)构建 MFC 应用程序需要 MFC 共享 dll 版本。请#define _AFXDLL 或不要使用/MD[d]

我已经定义了

#define _AFXDLL

但错误仍然发生。任何帮助表示赞赏!

【问题讨论】:

    标签: c++ dll mfc


    【解决方案1】:

    有两个设置必须相互一致:

    (1) Project > Properties > General > Use of MFC
    (2) Project > Properties > C/C++ / Code Generation / Runtime Library
    

    如果 (1) 设置为 Use MFC in static library,则 (2) 必须为 Multithreaded (/MT)Multithreaded Debug (/MTd)(在发布和调试版本中对应)。如果 (1) 是 Use MFC in Shared DLL,那么 (2) 必须是 Multi-threaded DLL (/MD)Multi-threaded Debug DLL (/MDd)

    当两者不同意时,你会得到你所显示的错误。

    【讨论】:

    猜你喜欢
    • 2013-05-09
    • 1970-01-01
    • 1970-01-01
    • 2014-04-29
    • 1970-01-01
    • 2014-03-10
    • 1970-01-01
    • 1970-01-01
    • 2013-09-03
    相关资源
    最近更新 更多