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


目录
相关文章
|
1月前
|
Unix 编译器 开发者
Qt5.14.2 轻松掌握Qt中的压缩与解压缩:QuaZIP的神秘面纱与实战演练之windows环境编译
Qt5.14.2 轻松掌握Qt中的压缩与解压缩:QuaZIP的神秘面纱与实战演练之windows环境编译
264 0
|
1月前
|
Java Windows
windows下 安装 Elasticsearch报错warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
windows下 安装 Elasticsearch报错warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
159 0
|
1月前
|
Windows
【报错】在浏览器输入localhost为什么启动的是Microsoft的IIS windows首页?
【报错】在浏览器输入localhost为什么启动的是Microsoft的IIS windows首页?
|
4天前
|
C++ UED 开发者
逆向学习 MFC 篇:视图分割和在 C++ 的 Windows 窗口程序中添加图标的方法
逆向学习 MFC 篇:视图分割和在 C++ 的 Windows 窗口程序中添加图标的方法
4 0
|
27天前
|
消息中间件 程序员 Windows
Windows消息机制《MFC深度详解》
Windows消息机制《MFC深度详解》
19 1
|
14天前
|
Linux Docker Windows
windows10安装docker报错【已解决】
windows10安装docker报错【已解决】
51 0
|
1月前
|
Perl
pod spec lint编译时报The 'Pods-App' target has transitive dependencies that include static binaries错误问题
pod spec lint编译时报The 'Pods-App' target has transitive dependencies that include static binaries错误问题
25 1
|
15天前
|
Windows
Qtdesigner报错:This application failed to stat could not find or load the Qt platform plugin “windows“
Qtdesigner报错:This application failed to stat could not find or load the Qt platform plugin “windows“
|
1月前
|
移动开发 jenkins 持续交付
jenkins编译H5做的android端编译卫士app记录
jenkins编译H5做的android端编译卫士app记录
21 0
|
1月前
|
计算机视觉 Windows
OpenCV + CLion在windows环境下使用CMake编译, 出现Mutex相关的错误的解决办法
OpenCV + CLion在windows环境下使用CMake编译, 出现Mutex相关的错误的解决办法
40 0