MSDN > フォーラム ホーム > Visual C++ Language > Hello visual studio 2008 dosent accept windows header defined len in Snmp.h, how to solve it
質問する質問する
 

全般的な情報交換Hello visual studio 2008 dosent accept windows header defined len in Snmp.h, how to solve it

  • 2009年11月2日 21:44Msvisual studio 2008 ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Once again i have found microsoft visual studio 2008 bugg it dosent accept len from Snmp.h


    error C2065: 'len' : undeclared identifier but lmao but this this header Snmp.h (where is defined len) should be default associated with windows.h, so now i added manually Snmp.h and still the visual studio 2008 says 'len' : undeclared identifier
    But the funny thing is that if i right click on len and choose go to declaration it props me to the Snmp.h header and shows that len is declared there but compiler wont accept it ....

    I tryed to compile the program with precompiled headers and without it but the compiler still ignores the windows defined len ...

すべての返信

  • 2009年11月2日 22:12jinzai ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    I think that you might be taking your symptoms to mean something other than what they actually mean.
    If you do not include "snmp.h" yourself in the source file that wants to use len...and you have not included "snmp.h" in the "stdafx.h" precompiled header file (Which should be included in the source file!), then you will get this message.

    snmp.h is *not* included by including "windows.h"

    If Intellisense is working, then...some file is including snmp.h, or it has been added to the project (Not at all the same thing!!!!!)

    I think you need to show your cards this time.
  • 2009年11月3日 22:01Msvisual studio 2008 ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    This line gives the error where len is undeclared identifierr but all the include headers are added and len is there already defined i tryed to define len manually still not working it just wont accept it ...

    stubLen

    += len;

    well it  works fine on visual studio 2003 same settings...

  • 2009年11月4日 6:22Wesley YaoMSFT, Moderatorユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hello,

    Are you talking about the struct SnmpVarBindList?

    typedef struct {
        SnmpVarBind * list;
        UINT          len;
    } SnmpVarBindList;


    If so, the correct way is:
    SnmpVarBindList svbl = {0, 0};
    UINT stubLen = svbl.len;

    If I misunderstand it, which "len" are you looking for?

    Sincerely,
    Wesley
    Please 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.
  • 2009年11月4日 21:03Msvisual studio 2008 ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    still no help yes i use

    typedef

    struct {

     

    SnmpVarBind * list;

     

    UINT len;

    }

    SnmpVarBindList;

    and with visula studio 2003 it works but 2008 it dosent work stupid 2008 pro bugged compiler i have to say ...

  • 2009年11月4日 21:45Brian MuthMVPユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Your post is incomplete. Post enough code to illustrate the line where the error occurs. Also, to make the post readable, use the "Insert Code Block" button. It's the icon next to "HTML" that looks like </>

  • 2009年11月9日 3:17Wesley YaoMSFT, Moderatorユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    We are changing the issue type to "General Discussion" because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by editing your initial post and click the button "Change Type" at the top of the post. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

    Thank you!


    Please 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.