Iphlpapi / ifdef.h

I am trying to use iphlpapi( GetAdapterInfo) and it is difficult for me to compile the code. I have iphlpapi.hfrom SDK 7 and added the appropriate path to include files in visual studio.

I get the following error ...

c: \ program files \ microsoft sdks \ windows \ v7.0 \ include \ ifdef.h (154): error C2146: syntax error: missing ';' before the identifier "NET_IFTYPE"

The lines in the ifdef where this occurs are shown below.

typedef NET_LUID IF_LUID, *PIF_LUID;
typedef ULONG NET_IFINDEX, *PNET_IFINDEX;       // Interface Index (ifIndex)
typedef UINT16 NET_IFTYPE, *PNET_IFTYPE;        // Interface Type (IANA ifType) 
+3
source share
2 answers

I finally figured out how to make it work, so I put it here for others who might stumble upon it.

-, Visual ++ 6.0 2003 sdk. sdk , TOOLS- > OPTIONS- > DIRECTORIES. include winsock2.h 60 . , , winsock2 include windows.h. windows.h include V++ stdafx.h, winsock2.h . !

+4

, , , , winsock2.h. , .

, MSDN NET_LUID , Vista. , true.

+2

Source: https://habr.com/ru/post/1723234/


All Articles