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

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

但是编译的时候报错:
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
看看那么多的文件没有头绪。
【解决方法】
在项目属性中,设置显示包含为是。

再次编译的时候,输出窗口中会给出详细的提示,这样就能够看到到底是哪个文件导致的。
根据报错的文件,发现有如下包含的头文件:
|
#include #include #include |
将#include
"afxinet.h" 放到最前面就可以了。
MFC apps must not include windows.h的更多相关文章
- fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
给对话框添加类, 报错 CalibrateMFCDlg.h(6) : error C2504: “CDialog”: 未定义基类 等多个错误 加上 #include "afxwin.h&qu ...
- MFC项目中包含atlimage.h导致fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
因为要用到CImage所以包含了atlimage.h 报这个错误的话你只需要把atlimage.h放在afxwin.h的下方即可,不能让它在afxwin.h的上方
- #include <windows.h>
1 FindWindowA 2 keybd_event 3 malloc 4 MessageBox 5 MessageBoxA 6 MessageBoxW 7 mouse_event 8 SetC ...
- vs2017自动生成的#include“stdafx.h”详解及解决方案
vs2017自动生成的#include“stdafx.h”详解及解决方案 问题描述: 在高版本的Visual Studio的默认设置中,会出现这么一个现象,在新建项目之后,项目会自动生成#includ ...
- c++中的#include "stdafx.h"
转自:https://blog.csdn.net/lijun5635/article/details/13090341 在网上看到的一篇很详细的文章解释,之前一直不明白这个头文件什么作用,用来学习很好 ...
- #include<unistd.h>存在linux中,含有系统服务的函数
#include<unistd.h> linux标准库#include <unistd.h>与windows的#include <windows.h>(C语言开发) ...
- #include <process.h>
1 _beginthread 单进程,单线程,必须干完一件事情后干另一件事情 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #incl ...
- #include <time.h>
1 _strtime 2 difftime 3 srand 4 time 1 _strtime 函数简介 函数名: _strtime 头文件: time.h 函数原型: char * _strtime ...
- windows.h与winsock2.h的包含顺序
#define WIN32_LEAN_AND_MEAN #include <windows.h>
随机推荐
- AFNetworking源码品读
AFNetworking源码品读 AFNetworking这个库几乎是所有苹果开发人员在使用HTTP协议的第一选择,为什么这个库会有这么大的吸引力呢?其实答案就需要问问自己,为什么会用它,而不是别的库 ...
- 【洛谷】4317:花神的数论题【数位DP】
P4317 花神的数论题 题目背景 众所周知,花神多年来凭借无边的神力狂虐各大 OJ.OI.CF.TC …… 当然也包括 CH 啦. 题目描述 话说花神这天又来讲课了.课后照例有超级难的神题啦…… 我 ...
- 【洛谷】2473:[SCOI2008]奖励关【期望DP(倒推)】
P2473 [SCOI2008]奖励关 题目背景 08四川NOI省选 题目描述 你正在玩你最喜欢的电子游戏,并且刚刚进入一个奖励关.在这个奖励关里,系统将依次随机抛出k次宝物,每次你都可以选择吃或者不 ...
- bzoj 3545/3551: [ONTAK2010]Peaks -- 主席树,最小生成树,倍增
3545: [ONTAK2010]Peaks Time Limit: 10 Sec Memory Limit: 128 MB Description 在Bytemountains有N座山峰,每座山峰 ...
- PYQT窗口托盘目录
#UI.py,通过UI设计师制作后直接转换为UI.py脚本 # -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui try: _fromU ...
- [Visual Studio] .vsix项目模板制作
Visual Studio (VSIX,项目模板 )制作 下载Vsiual Studio 2012 SDK 下载地址:http://www.microsoft.com/en-us/download ...
- Swift3.0字符串相关操作
以下有关字符串的常用操作都可直接复制到Xcode中进行验证,如发现错误,请在评论区留言指正! 1.字符串的定义 var str1="hello, swift." //字符串变量 相 ...
- mongodb exception in initAndListen: 12596 old lock file, terminating解决方法
错误信息如下: exception old lock file, terminating 解决方法 .删除data目录中的.lock文件 .mongod.exe --repair .启动mongod就 ...
- More about STALL
http://fx.damasgate.com/more-about-stall/ In other USB classes, a sender can indicate the end of a t ...
- SecureCRT远程连接Linux服务器及相关配置
这里的连接采用的是SSH2协议,关于SSH2协议可百度 一.连接不上可能的原因 1)服务器防火墙iptables /etc/init.d/iptables stop 2)SSH服务有问题 3)客户端到 ...