用VS2008建立一个DLL项目,一开始的时候不想用MFC, 所以选择的是使用标准Windows库。

使用了一段时间后又想用MFC了,所以把选项改成使用在共享 DLL 中使用 MFC。

但是编译的时候报错:

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

看看那么多的文件没有头绪。

【解决方法】

在项目属性中,设置显示包含为是。

再次编译的时候,输出窗口中会给出详细的提示,这样就能够看到到底是哪个文件导致的。

根据报错的文件,发现有如下包含的头文件:

#include "StdAfx.h"

#include "afxinet.h"

#include "HttpHelper.h"

将#include "afxinet.h" 放到最前面就可以了。

MFC apps must not include windows.h相关推荐

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

    http://ghyan1208.blog.163.com/blog/static/162866676201072511746382/ 错误原因主要是因为#include <afx.h>这 ...

  2. VC6.0编写BHO #error : WINDOWS.H already included. MFC apps must not #include windows.h

    VC6.0编写BHO #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h> 在StdA ...

  3. 【错误记录】Windows 控制台程序编译报错 ( WINDOWS.H already included. MFC apps must not #include <Windows.h> )

    文章目录 一.报错信息 二.解决方案 一.报错信息 Windows 控制台程序编译报错 : 已启动生成- 1>------ 已启动生成: 项目: hacktool, 配置: Debug Win3 ...

  4. #include Windows.h 和 Winsock2.h冲突的改进解决方案

    #include <Windows.h> #include <Winsock2.h> 上面的代码会导致重定义错误, 原因就是 Windows.h 中包含了 Winsock.h( ...

  5. c语言#include windows.h,c语言之ls目录的简单实现和window版本dirent.h

    #include #if _WIN32 #include #include #include "dirent.h" #else #include #include #endif / ...

  6. c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189:

    编译时报下面错误的解决方法 c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error ...

  7. Visual C++中 #include stdafx.h 头文件的用法

    今天在做VC++实验时,总是出现莫名其妙的错误.比如说: unexpected end of file whilelooking for precompiled header directive 再比 ...

  8. C/C++—— #include“stdafx.h”详解

    转自:http://blog.csdn.net/qingkong8832/article/details/6695123 1,用VS2008新建项目,选择[Win32]-[Win32控制台应用程序]- ...

  9. Windows.h 常用API函数【转】

    转自:https://blog.csdn.net/farmwang/article/details/50603608 http://www.vbgood.com/api.html http://hi. ...

最新文章

  1. linux http 配置文件,Linux http配置文件解析
  2. css二级菜单的隐藏与显示_具有二级菜单的导航案例
  3. 第二个mysql怎么装_Linux下安装两个MySQL的方法
  4. jfinal文件上传
  5. php mysql study_PHPstudy升级mysql数据库
  6. 进程控制1--fork vfork函数
  7. 学计算机的心理300字,心理的作文300字7篇
  8. Matlab7.0安装之后Runtime Error警告解决办法
  9. 如何保证高可用?java删除文件夹下所有文件,技术详细介绍
  10. 深度学习模型压缩方法
  11. xshell 上传文件
  12. python处理图片文件,python 间接处理webp图片文件
  13. Python本地文件合并(csv)
  14. VS中fseek.cpp引发断点——将一个无效参数传递给了将无效参数视为严重错误的函数
  15. SOFA BOLT源码解析之设计要点-线程模型
  16. 微信跳转外部浏览器下载
  17. 如何考取谷歌分析证书 (google analytics individual qualification)
  18. 【技术栈】【SSM】SMM的常用注解
  19. RS-232/RS-485/RS-422通信协议介绍
  20. Power PMAC运动控制器 —— 学习笔记6

热门文章

  1. Netty和RPC框架线程模型分析
  2. java开发,年薪15W的你和年薪50W的他的差距
  3. Mysql 锁的机制
  4. linux中yum命令详解
  5. linux screen 配置(下标高亮)
  6. cookie的简单学习
  7. windows环境下安装python的mysqldb模块
  8. Excel中Sumproduct函数的使用方法
  9. Add Binary
  10. caxa电子图板2018中文版