【错误记录】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>


目录
相关文章
|
11月前
|
安全 Ubuntu iOS开发
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
353 3
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
|
Windows
Windows下版本控制器(SVN)-验证是否安装成功+配置版本库+启动服务器端程序
Windows下版本控制器(SVN)-验证是否安装成功+配置版本库+启动服务器端程序
380 2
|
Windows
Windows下版本控制器(SVN)-启动服务器端程序
Windows下版本控制器(SVN)-启动服务器端程序
699 4
|
Ubuntu Linux Windows
如何在Ubuntu系统中安装Wine,借此来运行Windows程序
熟悉的登录画面出现,在Ubuntu系统中扫描登录微信程序。
|
Unix Linux 编译器
解决在Windows平台上运行Golang程序时出现的syscall.SIGUSR1未定义错误。
通过这种结构,你的代码既可以在支持 SIGUSR1 信号的系统上正常工作,又可以在不支持这些信号的 Windows 系统上编译通过,确保跨平台的兼容性和功能的完整性。
432 0
|
安全 Devops 测试技术
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
294 0
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
|
安全 JavaScript Java
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
309 12
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
|
搜索推荐 数据挖掘
直播App程序源码开发前期功能调研:运营角度思考如何有利于推广运营获利
在直播App程序源码开发的前期,功能调研至关重要。除了技术实现的可行性,更需要从运营角度出发,思考哪些功能能够助力推广运营,最终实现获利。山东布谷科技从运营角度,对直播App功能进行调研分析
|
Windows
Windows程序的数字签名证书怎么申请
Windows程序的数字签名证书申请流程包括:准备企业资料(营业执照、税务登记证等),提交申请表及企业资料。经过初审、实名认证和二审后,等待1-5个工作日审核结果。审核通过后,CA机构颁发证书并通过邮件或邮寄方式发送。收到证书后按指南安装并使用签名工具对程序进行数字签名,确保软件完整性和可信度。注意证书有效期、管理和兼容性问题。
|
自然语言处理 安全 测试技术
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
1098 0
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试

热门文章

最新文章