fatal error C1189: #error : WINDOWS.H already incl

本文解决了一个常见的MFC项目编译错误:fatal error C1189: #error: WINDOWS.H already included. MFC应用不应该直接包含<windows.h>。正确的做法是在stdafx.h中包含<afxwin.h>。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

        用MFC编译总是出现这个错误:

fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>


解决方法:

在stdafx.h里面包含#include <afxwin.h> 



OK

转载于:https://my.oschina.net/lvguidong/blog/542294

安装报错(gprMax) D:\2025Spring\sx\gprMax-v.3.1.7>pip install pycuda==2022.2.2 Collecting pycuda==2022.2.2 Using cached pycuda-2022.2.2.tar.gz (1.7 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pytools>=2011.2 (from pycuda==2022.2.2) Using cached pytools-2025.2.2-py3-none-any.whl.metadata (2.9 kB) Collecting appdirs>=1.4.0 (from pycuda==2022.2.2) Using cached appdirs-1.4.4-py2.py3-none-any.whl.metadata (9.0 kB) Collecting mako (from pycuda==2022.2.2) Using cached mako-1.3.10-py3-none-any.whl.metadata (2.9 kB) Requirement already satisfied: platformdirs>=2.2 in d:\programdata\anaconda3\envs\gprmax\lib\site-packages (from pytools>=2011.2->pycuda==2022.2.2) (4.3.7) Collecting siphash24>=1.6 (from pytools>=2011.2->pycuda==2022.2.2) Using cached siphash24-1.7.tar.gz (19 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [26 lines of output] + meson setup C:\Users\vbh\AppData\Local\Temp\pip-install-wqr381ay\siphash24_b648780c01dd4ef48455fc9754149aff C:\Users\vbh\AppData\Local\Temp\pip-install-wqr381ay\siphash24_b648780c01dd4ef48455fc9754149aff\.mesonpy-joxc29yp -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\vbh\AppData\Local\Temp\pip-install-wqr381ay\siphash24_b648780c01dd4ef48455fc9754149aff\.mesonpy-joxc29yp\meson-python-native-file.ini Cloning into 'libcsiphash-1'... fatal: unable to access 'https://hub.njuu.cf/c-util/c-siphash.git/': Could not resolve host: hub.njuu.cf The Meson build system Version: 1.8.2 Source dir: C:\Users\vbh\AppData\Local\Temp\pip-install-wqr381ay\siphash24_b648780c01dd4ef48455fc9754149aff Build dir: C:\Users\vbh\AppData\Local\Temp\pip-install-wqr381ay\siphash24_b648780c01dd4ef48455fc9754149aff\.mesonpy-joxc29yp Build type: native build Project name: python-siphash24 Project version: undefined C compiler for the host machine: cl (msvc 19.29.30159 "用于 x86 的 Microsoft (R) C/C++ 优化编 译器 19.29.30159 版") C linker for the host machine: link link 14.29.30159.0 Cython compiler for the host machine: cython (cython 3.1.2) Host machine cpu family: x86 Host machine cpu: x86 Did not find pkg-config by name 'pkg-config' Found pkg-config: NO Found CMake: C:\vscode\cmake-3.27.2-windows-x86_64\bin\cmake.EXE (3.27.2) Run-time dependency libcsiphash-1 found: NO (tried pkgconfig and cmake) Looking for a fallback subproject for the dependency libcsiphash-1 Building fallback subproject with default_library=static ERROR: Subproject libcsiphash-1 is buildable: NO ..\meson.build:14:14: ERROR: Git command failed: ['D:\\ProgramData\\anaconda3\\Library\\bin\\git.EXE', 'clone', 'https://github.com/c-util/c-siphash.git', 'libcsiphash-1'] A full log can be found at C:\Users\vbh\AppData\Local\Temp\pip-install-wqr381ay\siphash24_b648780c01dd4ef48455fc9754149aff\.mesonpy-joxc29yp\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
最新发布
07-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值