开发者

Error including fwpmu.h in Visual Studio 2010

开发者 https://www.devze.com 2023-03-02 17:12 出处:网络
I\'m trying to call some WFP functions from a C++ CLR class library (New Project -> Visual C++ -> CLR -> Class Library)

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 s开发者_开发百科olution, 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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消