致命错误 C1189:#error:窗口。H 已包括在内。MFC 应用不得 #include < Windows.h>
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
我有一个使用SQL Compact Server的Visual Studio 6.0项目。我试图更新解决方案,在Visual Studio 2012上使用,但我有以下错误:
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
我的stdafx.h包括winsock2.h,它有这个:
#ifndef _INC_WINDOWS
#include <windows.h>
#endif /* _INC_WINDOWS */
有一种方法可以抑制错误吗?我该怎么做?当我删除间接包含它的文件的windows.h时,我得到error C2011: 'IRowsetBookmark' : 'struct' type redefinition
我已经在这里看到了关于这个错误的其他问题,但是没有一个建议适合我。
——更新:
我在stdafx.h的顶部添加以下行来解决error C2011: 'IRowsetBookmark' : 'struct' type redefinition
:
#if !defined(__IRowsetBookmark_INTERFACE_DEFINED__)
#define __IRowsetBookmark_INTERFACE_DEFINED__
#endif
#if !defined(__IRowsetBookmark_FWD_DEFINED__)
#define __IRowsetBookmark_FWD_DEFINED__
#endif
但我得到了error C2143: syntax error : missing ',' before '<'
在那一行:
class CArrayRowset :
public CVirtualBuffer<T>,
public TRowset
{
是否有可能在我的stdfix .h上添加这些行弄乱了一些类声明?
尝试在包含winsock2.h之前定义_INC_WINDOWS
相关文章:
- 既然存在危险,为什么项目要使用-I include开关
- 有充分的理由在h文件中使用include保护而不是cpp文件吗
- 如何将更多文件夹添加到c++include路径
- 什么是"#include <boost/functional/hash.hpp> "?
- EASTL矢量<向量<int>>连续的
- 对于MacOS上的G++,如何添加默认的include目录/usr/local/include和默认的库搜索路径/usr
- C++包含来自 #include "DevEngine/Core.h" 的错误
- <filesystem> 在 clang 6 和 10 上 #include 错误
- 在 void 函数中使用 #include 变量C++
- N-API include an .so or dll
- 允许哪些令牌作为 #include 的参数?
- GCC 包含标头(使用"-include")CMake 未检测到的更改
- WebAssembly include OpenCV
- 如何在 c++ 中正确指定 #include 路径以使程序可移植
- 修改生成文件以简化框架 #include 路径
- VS2015/VC++ 在新类模板中禁用默认 #include "stdafx.h"
- macOS 致命错误:sys/_types/_int8_t.h:没有此类文件或目录 #include < sys/_types/_int8_t.h>
- #include < conio.h> 和 getch() 方法之间的关系是什么?
- 如何将构建的C++库安装到 /usr/include?
- opencv 2.4.7在iOS错误背景_segm.hpp #include&lt; list&gt;未找到