how do you solve a C2065 error?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Blake Atlas
    New Member
    • Aug 2010
    • 5

    #1

    how do you solve a C2065 error?

    The problem recieved from the debug log is the C2065 error regarding the 'm_pEffect' and 'm_pd3dDevice' being undeclared identifiers.


    Code:
    D3DApplication::D3DApplication(){
    m_pEffect     = NULL; 
    m_pD3D	      = NULL; 
    m_pd3dDevice  = NULL; 
    }
    VOID D3DApplication::relD3DObjects(){
    m_threeDobject.relD3DObjects();
    if( m_pd3dDevice != NULL ){
    m_pd3dDevice->Release();	
    m_pd3dDevice = NULL;
    }
    if( m_pD3D != NULL ){
    m_pD3D->Release();
    m_pD3D = NULL;
    }
    if( m_pEffect != NULL ){
    m_pEffect->Release();	
    m_pEffect = NULL;
    }
    }
    There is quite alot more code relating to these identifiers, but I would say that it has something to do with the code I have given, if you need more just let me know.
    Last edited by Niheel; Aug 2 '10, 06:53 PM. Reason: grammar
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Try reading the documentation for C2065 undeclared identifer.

    You have not declared the 3 symbols you mention anywhere. From the m_ prefix I assume they should be members of the class D3DApplication so I suggest you look at the definition of that class.

    Comment

    • Blake Atlas
      New Member
      • Aug 2010
      • 5

      #3
      This is the included D3DApplication files declaration code

      Code:
      class D3DApplication
      {
      private: 
      LPD3DXEFFECT 	        m_pEffect; 
      LPDIRECT3D9             m_pD3D;			
      LPDIRECT3DDEVICE9       m_pd3dDevice;
      Is this the section you was relating to?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Yes, do you get any errors on that declaration?

        Is the header that that declaration is in included into your C++ file?

        Comment

        • Blake Atlas
          New Member
          • Aug 2010
          • 5

          #5
          yes this code was already in there and yes the header file is included in the c++ file.

          I think the solution is to make member variable declarations as approriate, but I am not sure what to declare them as inorder for them to be identified.

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #6
            No your code in post 3 are the variable declarations.

            Is the 2065 error the first one you are getting? Try posting the full output of your compiler.

            Comment

            • Blake Atlas
              New Member
              • Aug 2010
              • 5

              #7
              Here's the build log of all the errors for the program. Hope it helps.

              c:\documents and settings\packar dbell\my documents\sourc efiles\d3dappli cation.cpp(93) : error C2039: 'initEffectObje ct' : is not a member of 'D3DApplication '

              c:\documents and settings\packar dbell\my documents\sourc efiles\d3dappli cation.h(27) : see declaration of 'D3DApplication '

              c:\documents and settings\packar dbell\my documents\sourc efiles\d3dappli cation.cpp(98) : error C2065: 'm_pd3dDevice' : undeclared identifier

              c:\documents and settings\packar dbell\my documents\sourc efiles\d3dappli cation.cpp(98) : error C2065: 'm_pEffect' : undeclared identifier

              Comment

              • newb16
                Contributor
                • Jul 2008
                • 687

                #8
                initEffectObjec t' : is not a member of 'D3DApplication '
                - right, all it has is some m_... variables and no initWhatever.

                Comment

                • Blake Atlas
                  New Member
                  • Aug 2010
                  • 5

                  #9
                  so initEffectObjec t

                  Code:
                  HRESULT D3DApplication::initEffectObject()
                  {
                  HRESULT hr;
                  if( FAILED( hr = D3DXCreateEffectFromFile( m_pd3dDevice, 			".\\Effects\\TransfPipeline.fx", NULL, NULL, 
                  D3DXSHADER_DEBUG, NULL, &m_pEffect, NULL ) ) )
                  return hr;
                  return S_OK;
                  }
                  needs to be declared in

                  Code:
                  class D3DApplication
                  {
                  private: 		
                  LPD3DXEFFECT 	        m_pEffect;  		
                  LPDIRECT3D9             m_pD3D;			 
                  LPDIRECT3DDEVICE9       m_pd3dDevice;
                  or do I need to declare initEffectObjec t as just an int or relate it to D3DXSHADER in the header file or both or neither?
                  Last edited by Blake Atlas; Aug 6 '10, 03:22 PM. Reason: repeating sentences

                  Comment

                  Working...