locked
error C2065: 'INFSTR_SECT_VERSION' : undeclared identifier RRS feed

  • Question

  • On debugging, i got following error  :      Error 5 error C2065: 'INFSTR_SECT_VERSION' : undeclared identifier

    Please help to resolve it..

    Tuesday, January 24, 2012 2:32 PM

Answers

  • As far as I know C2065 is a C++ compiler error. You have to declare a variable before using it.
    Compiler Error C2065
    http://msdn.microsoft.com/en-us/library/ewcf0002(v=vs.100).aspx
    For example a definition with same name INFSTR_SECT_VERSION is in infstr.h, where it is defined as

    TEXT("Version").


    But certainly type and value of a variable are depending entirely on your application.

    With kind regards

     

    • Marked as answer by Mike Dos Zhang Wednesday, February 1, 2012 7:55 AM
    Tuesday, January 24, 2012 4:56 PM
  • This identifier is defined in the infstr.h header file.

    And the file is placing here: C:\WinDDK\7600.16385.1\inc\api\infstr.h

    //  General information about the contents/origins of the .INF.

    #define INFSTR_SECT_VERSION             TEXT("Version")

    If you do not need others definition in this header file, and do not like to install DDK, then we just can use it like this:

    #include "stdafx.h"
    #include <iostream>
    #include "windows.h"
    //#include <string>
    //#include <sstream>
    using namespace std;
    
    #define INFSTR_SECT_VERSION TEXT("Version")
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	cout << INFSTR_SECT_VERSION;
    	getchar();
    	return 0;
    }
    
    This is not a Visual Studio Debugger problem, it is a C++ question, please use C++ forum if you have any more C++ programming question.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Mike Dos Zhang Wednesday, February 1, 2012 7:55 AM
    Wednesday, January 25, 2012 6:34 AM

All replies

  • As far as I know C2065 is a C++ compiler error. You have to declare a variable before using it.
    Compiler Error C2065
    http://msdn.microsoft.com/en-us/library/ewcf0002(v=vs.100).aspx
    For example a definition with same name INFSTR_SECT_VERSION is in infstr.h, where it is defined as

    TEXT("Version").


    But certainly type and value of a variable are depending entirely on your application.

    With kind regards

     

    • Marked as answer by Mike Dos Zhang Wednesday, February 1, 2012 7:55 AM
    Tuesday, January 24, 2012 4:56 PM
  • This identifier is defined in the infstr.h header file.

    And the file is placing here: C:\WinDDK\7600.16385.1\inc\api\infstr.h

    //  General information about the contents/origins of the .INF.

    #define INFSTR_SECT_VERSION             TEXT("Version")

    If you do not need others definition in this header file, and do not like to install DDK, then we just can use it like this:

    #include "stdafx.h"
    #include <iostream>
    #include "windows.h"
    //#include <string>
    //#include <sstream>
    using namespace std;
    
    #define INFSTR_SECT_VERSION TEXT("Version")
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	cout << INFSTR_SECT_VERSION;
    	getchar();
    	return 0;
    }
    
    This is not a Visual Studio Debugger problem, it is a C++ question, please use C++ forum if you have any more C++ programming question.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Mike Dos Zhang Wednesday, February 1, 2012 7:55 AM
    Wednesday, January 25, 2012 6:34 AM