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>
随机推荐
- 理解Django的makemigrations和migrate
在你改动了 model.py的内容之后执行下面的命令: python manger.py makemigrations 相当于在该app下建立 migrations目录,并记录下你所有的关于modes ...
- Python168的学习笔记4
关于普通文本文件的读写 python2.7中,未注明的字符都是以acsii来编码的,而要让字符能够通用,必须声明为unicode. s=u'你好',s.encode('utf8')就是指用utf8来进 ...
- Push导航栏黑影问题
解决方法可以在自定义的 TabbarViewController里 viewDidLoad方法里 self.view.backgroundColor = [UIColor whiteColor]; 如 ...
- Linux新内核:提升系统性能 --Linux运维的博客
http://blog.csdn.net/linuxnews/article/details/52864182
- php Function split() is deprecated 的解决办法
原文地址: http://www.cnblogs.com/mfryf/archive/2012/05/31/2527307.html php升级为5.3后,程序会报 Function split() ...
- error launching remote program failed to get the task for process
Error Starting executable: error launching remote program failed to get the task for process 715 这个 ...
- 修改后无警告全面支持non-ARC以及ARC的OpenUDID
OpenUDID Open source initiative for a universal and persistent UDID solution for iOS. 首创的给iOS提供设备唯一标 ...
- ping + 时间 日志
:top set PINGIP="192.168.1.236" echo %date% %time%>>%PINGIP%.txt ping -n 1 %PINGIP% ...
- Servlet字符编码过滤器
在Java Web程序开发中,由于Web容器内部使用编码格式并不支持中文字符集,所以,处理浏览器请求中的中文数据就会出现乱码的现象.由于Web容器使用了ISO-8859-1的编码格式,所以在Web应用 ...
- SystemVerilog Event Scheduling Algorithm
While simulating System Verilog design and its test-bench including assertions, events has to be dyn ...