locked
Undeclared Identifier in iphlpapi.h. RRS feed

  • Question

  • Hello all,

    I am having trouble compiling a program in Visual Studio 2010 Beta 2, and have searched around for an answer with no avail. In iphlpapi.h there are a few undeclared identifiers that are preventing my program from compiling: 'PMIB_IPSTATS' and 'PMIB_TCPSTATS'. I have downloaded source for an older open source project (with no current support) and it did work previously on Visual Studio 2008, so I know it is not the code itself. 

    Thank you in advance,
    Nick Taylor.

    P.S.: If I missed anything I am sorry and I will try to reply to you post with the relative information as soon as I can.
    Friday, October 30, 2009 3:06 AM

Answers

  • Hi Gasilli,

    As Sheng Jiang says, PMIB_IPSTATES and PMIB_TCPSTATS are Windows SDK structures, they are defined in iprtrmib.h file. So I would suggest you to check if iprtrmib.h is included in iphlpapi.h correctly.

    For more information about these two structures, please refer to :

    Best Regards,
    Nancy

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Friday, November 6, 2009 1:35 AM
    Monday, November 2, 2009 5:41 AM

All replies

  • Those are Windows SDK structures. How did you specify the target OS?

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    Saturday, October 31, 2009 12:49 AM
  • Hi Gasilli,

    As Sheng Jiang says, PMIB_IPSTATES and PMIB_TCPSTATS are Windows SDK structures, they are defined in iprtrmib.h file. So I would suggest you to check if iprtrmib.h is included in iphlpapi.h correctly.

    For more information about these two structures, please refer to :

    Best Regards,
    Nancy

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Friday, November 6, 2009 1:35 AM
    Monday, November 2, 2009 5:41 AM
  • I´m currently running into the same problem as Gasilli. I checked the includes and I can state that iprtrmib.h is included in iphlpapi. I tried to directly include Ipmib.h to my project but that doesn´t seem to be necessary as the docu states.

    "On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files has changed and the MIB_IPSTATS structure is defined in the Ipmib.h header file not in the Iprtrmib.h header file. Note that the Ipmib.h header file is automatically included in Iprtrmib.h which is automatically included in the Iphlpapi.h header file. The Ipmib.h and Iprtrmib.h header files should never be used directly."

     

    It´s strange that Intellisense finds the necessary include while the compiler doesn´t. Any hints - something I could try out?!?!?!?

    Best Regards - Stefan

     

    P.S.:

    I´m developing under Windows 7 64 bit with the trial Version of VisualStudio 2010 (WindowsSDK 7.0A).

    Monday, May 10, 2010 6:58 AM
  • Just wanted to say thank you Nancy! :D

    Hit the IPSTATS issue while porting some code up from 2003 to 2010. All I had to do is swap out the Iptrmib.h include with Ipmib.h as the MIB_IPSTATS Structure remarks suggest and all those warnings and errors went away.

    Sunday, December 11, 2011 9:55 PM