我创建了简单的wxwidgets对话框(首先必须包含“wx / wxprec.h”),但还想重新使用另一个需要这些标题的应用程序中的一些公共代码:
#include "wx/wxprec.h"
#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxdtctl.h>
#include <afxcmn.h>
#include <afxsock.h>
#include <afxmt.h>
然后我收到了这些错误:
c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxv_w32.h(16): fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
任何想法如何在wxwidgets项目中包含这些MFC文件?
答案 0 :(得分:1)
Hans Passant的评论是正确的,如果您必须同时使用MFC和wxWidgets,则必须首先包含MFC标头。有关工作示例,请参阅wxWidgets MFC sample。