当前位置: 代码迷 >> 综合 >> error C1189: #error : WINDOWS.H already included. MFC apps must not #include windows.h
  详细解决方案

error C1189: #error : WINDOWS.H already included. MFC apps must not #include windows.h

热度:37   发布时间:2024-01-20 20:10:31.0

 c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>
     错误原因:多次包含 window.h 头文件
    Location:
 --afxv_w32.h
#ifdef _WINDOWS_#error WINDOWS.H already included.  MFC apps must not #include <windows.h>
#endif


参考其他博文(leowangzi),解释是:Project,General 属性中Use of MFC是可以用的,因此程序会自动调用。
解决方法:
博主(leowangzi)将stdafx.h中#include "afxtempl.h"放到程序所包含的所有头文件的前面,而我得并没有此文件,于是把#include <afxdtctl.h>    // MFC 支援的 Internet Explorer 4 通用控制項,移到最前面。编译成功。

  相关解决方案