wint .h包括问题
winnt.h include problems
我有一个简单的控制台应用程序,它是另一个解决方案的一部分。我决定在新的解决方案中单独使用这个应用程序。在我打开这个应用程序并保存在新创建的解决方案后,我有以下错误:
Error 9 error C2059: syntax error : ')' c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 12984
Error 4 error C2065: 'PCONTEXT' : undeclared identifier c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 12983
Error 10 error C2143: syntax error : missing ';' before '__stdcall' c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 13372
Error 5 error C2146: syntax error : missing ')' before identifier 'ContextRecord' c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 12984
Error 1 error C2146: syntax error : missing ';' before identifier 'ContextRecord' c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 6361
Error 7 error C2182: 'RtlCaptureContext' : illegal use of type 'void' c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 12984
Error 8 error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 12984
Error 13 error C3861: '__readfsdword': identifier not found c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 14982
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 6361
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 6361
Error 11 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 13372
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 13376
14 IntelliSense: identifier "PCONTEXT" is undefined c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 6361
15 IntelliSense: identifier "PCONTEXT" is undefined c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 12983
16 IntelliSense: identifier "PCONTEXT" is undefined c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 13371
Warning 6 warning C4229: anachronism used : modifiers on data are ignored c:program files (x86)microsoft sdkswindowsv7.0aincludewinnt.h 12984
对我来说,在那种情况下创建新的控制台应用程序要比找出问题所在容易得多,但为了获得更多经验,我决定找出问题所在。我比较了这两个应用程序(新创建的编译应用程序和有错误的应用程序)的C/C++
和Linker
设置,发现它们之间没有差异。哪里可能会出现问题,如何减缓这些问题?
如果有人像我一样通过谷歌发现这一点:对于CLI/c++项目,确保您包含的任何非托管.cpp文件都设置为不支持CLR编译。请看下面的链接和汉斯·帕桑特的回答。
这为我修复了这个问题。
使用#pragma managed/unmanaged的正确方法相关文章:
- 在单元测试项目中包括 .c 文件,并从多个 cpp 文件访问它而不会出现链接问题
- C++ 将问题包含在其他文件中?(提升包括)
- 用libclang解析源文件 - 链接问题包括文件
- C 两个派生的类中有彼此的对象(包括问题)
- Xcode(版本9.2(9C40B)):试图包括Boost时C 语义和链接器问题
- 问题包括Curl Lib在Visual Studio 2015中用于C 程序
- 关于包括新类的基本问题
- 试图包括我的源文件的问题
- 包括库C++的问题
- 遇到包括提升 binary_oarchive.hpp 在内的问题
- 我在 c++ 中的赋值重载运算符有什么问题?(包括详细信息)
- 映射迭代器问题.包括代码
- 问题包括来自不同目录的头文件[不是路径问题]
- wint .h包括问题
- Visual studio 2010,包括openssl问题
- 在 Eclipse 上安装 OpenCV for Android 的问题:各种错误,包括"在 PATH 中找不到"
- 包括3.2.6到4.5.1更新后的文件问题
- Eclipse CDT 无法构建 - 不确定出了什么问题(包括控制台)
- 菜鸟问题:包括在Netbeans + MinGW
- MSVC 的问题包括