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

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

文章目录

一、报错信息

二、解决方案





一、报错信息


Windows 控制台程序编译报错 :


已启动生成…
1>------ 已启动生成: 项目: hacktool, 配置: Debug Win32 ------
1>HackCommand.cpp
1>D:\001_Develop\017_Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\atlmfc\include\afxv_w32.h(16,1): fatal error C1189: #error:  WINDOWS.H already included.  MFC apps must not #include <Windows.h>
1>hacktool.cpp
1>D:\001_Develop\017_Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\atlmfc\include\afxv_w32.h(16,1): fatal error C1189: #error:  WINDOWS.H already included.  MFC apps must not #include <Windows.h>
1>正在生成代码...
1>已完成生成项目“hacktool.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========


image.png





二、解决方案


调整 #include 代码包含顺序 ;


先引入 afxwin.h 头文件 , 再 引入 Windows.h 头文件 ;


#include <afxwin.h>
#include <Windows.h>


目录
相关文章
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
5085 7
|
监控 数据挖掘 API
快应用报错Module Error 分包要求 app.json#minPlatformVersion 不小于 1061, 当前值为 21解决方案-优雅草卓伊凡
快应用报错Module Error 分包要求 app.json#minPlatformVersion 不小于 1061, 当前值为 21解决方案-优雅草卓伊凡
344 0
|
测试技术 Linux 网络安全
【App Services】App Service报错远程证书无效 - "The remote certificate is invalid according to the validation procedure"
在开发环境中,新部署的应用(App Service)无法与 Salesforce 的远程端点建立 SSL/TLS 连接,报错显示证书无效。经分析,防火墙启用了 SSL Inspection,插入了私有 CA 签发的中间证书,导致 App Service 无法验证。解决方案包括禁用 SSL Inspection、设置 `WEBSITE_LOAD_ROOT_CERTIFICATES` 环境变量或临时禁用代码中的 SSL 验证(仅限测试环境)。
529 8
|
搜索推荐 数据挖掘
直播App程序源码开发前期功能调研:运营角度思考如何有利于推广运营获利
在直播App程序源码开发的前期,功能调研至关重要。除了技术实现的可行性,更需要从运营角度出发,思考哪些功能能够助力推广运营,最终实现获利。山东布谷科技从运营角度,对直播App功能进行调研分析
【Azure App Service】使用Microsoft.Office.Interop.Word来操作Word文档,部署到App Service后报错COMException
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)).
513 2
|
Web App开发 Shell Linux
MacOS环境-手写操作系统-41-mem 第一个控制台程序
MacOS环境-手写操作系统-41-mem 第一个控制台程序
286 1
|
存储 Shell 开发工具
8-8|windows上Git报错
8-8|windows上Git报错
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
299 4
|
开发工具 git
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
463 3
|
开发框架 .NET Windows
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
278 2

热门文章

最新文章