Visual Studio 2010 中包含 fwpmu.h 时出错
我试图从 C++ CLR 类库(新项目 -> Visual C++ -> CLR -> 类库)调用一些 WFP 函数
代码:
#include <windows.h>
#include <fwpmu.h>
#pragma comment (lib, "fwpuclnt.lib")
仅此,Windows SDK 中的许多包含文件无法编译。我缺少什么?
示例:
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (program files)\microsoft sdks\windows\v7.0a\include\fwptypes.h 336 1 testlib
编辑:
我找到了解决方案,这是某些头文件中的错误: http://social.msdn.microsoft.com/Forums/en/wfp/thread/8fd93a3d-a794-4233-9ff7-09b89eed6b1f
并且 CLR 和另一个标头之间存在冲突:http://social.msdn。 microsoft.com/Forums/en/vcgeneral/thread/92c473d6-c963-44fa-9150-6c6af502112b
I'm trying to call some WFP functions from a C++ CLR class library (New Project -> Visual C++ -> CLR -> Class Library)
Code:
#include <windows.h>
#include <fwpmu.h>
#pragma comment (lib, "fwpuclnt.lib")
With only that, many include files from the Windows SDK fail to compile. What am I missing?
Example:
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (program files)\microsoft sdks\windows\v7.0a\include\fwptypes.h 336 1 testlib
Edit:
I found the solution, it's a bug in some header files: http://social.msdn.microsoft.com/Forums/en/wfp/thread/8fd93a3d-a794-4233-9ff7-09b89eed6b1f
And a conflict between the CLR and another header: http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/92c473d6-c963-44fa-9150-6c6af502112b
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了解决方案,这是某些头文件中的错误: http://social.msdn.microsoft.com/Forums/en/wfp/thread/8fd93a3d-a794-4233-9ff7-09b89eed6b1f
CLR 和另一个标头之间存在冲突:<一个href="http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/92c473d6-c963-44fa-9150-6c6af502112b" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/92c473d6-c963-44fa-9150-6c6af502112b
I found the solution, it's a bug in some header files: http://social.msdn.microsoft.com/Forums/en/wfp/thread/8fd93a3d-a794-4233-9ff7-09b89eed6b1f
And a conflict between the CLR and another header: http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/92c473d6-c963-44fa-9150-6c6af502112b
我也遇到了这个错误,但不幸的是,Izm 提供的长期答案并没有为我解决它。我还尝试修复和重新安装 Visual Studio 等,但无济于事。
就我而言,最终修复的方法是重新安装 8.0 的 Windows SDK。无论出于何种原因,该文件在它应该位于的
C:\Program Files (x86)\Windows Kits\8.0\Include\um
目录中丢失了。该文件位于其他各个位置。 Windows SDK(8.1 和 10),但不在项目使用的 SDK 中。我不知道为什么它丢失了,但通过查看相关 C++ 项目的属性并查看其继承的包含目录选项的评估结果(最终成为 8.0 套件文件夹),我发现它不存在。我以为它就在那里,因为我在其他文件夹中看到了该文件,但它不在正确的文件夹中,大概是因为某个地方弄乱了我的 8.0 SDK 文件。
希望这可以帮助其他遇到错误或类似错误的人。
I also had this error, but the longstanding answer provided by Izm didn't resolve it for me, unfortunately. I also tried repairing and reinstalling Visual Studio, among other things, to no avail.
In my case, what finally fixed it was to reinstall the Windows SDK for 8.0. For whatever reason, the file was missing from the
C:\Program Files (x86)\Windows Kits\8.0\Include\um
directory it should have been in. The file was in various other places for other Windows SDKs (8.1 and 10), but not in the one used by the project.I don't know why it was missing, but I found out it wasn't there by looking at the properties of the relevant C++ project and seeing what its inherited Include Directories options evaluated to, which ended up being the 8.0 kit folder. I thought it was there since I saw the file in other folders, but it wasn't in the correct folder, presumably because something somewhere messed up the 8.0 SDK files for me.
Hope this helps anyone else out there experiencing the error or ones similar.