which situation does'error C2039' happen?

when i compile my code,i get this error

error C2039: 'Import3dmax3DS' : is not a member of 'C3dWorld'
see declaration of 'C3dWorld'

but i have define 'Import3dmax3DS' in 'C3dWorld'

which situation does 'error C2039' happen



Answer this question

which situation does'error C2039' happen?

  • Naolin

    it went wrong here

    ......

    C3dObject* pObject = m_pWorld->Import3dmax3DS(szPath, FALSE);

    ......

    and i declare it here

    class AFX_EXT_CLASS C3dWorld : public CObject
    {
    DECLARE_DYNAMIC(C3dWorld);

    ......

    C3dObject* Import3dmax3DS(LPCSTR lpszFileName, BOOL bAddToList=TRUE);

    ......

    t


  • dhino

    Is there a chance that the definition is excluded due to a #ifdef/#endif part.

  • Bungaman

    If this is really the order in which your code is arranged then the error message is because you are using the field before you have declared it.

  • Attila Fogel

    Show us some code. Deklaration of the class, and some llines were the error occurs.

  • peterhal

    In a case like this I would preprocess the file and make sure that the compiler can really see the declaration. Also with "compilcated" identifers like this I would double (and triple) check that it is spelt correctly: though from what I can see above it appears to be.

  • siva_venugopal

    after rebuild all(it takes a lot of times),it works

    thank you all


  • Wim Bouma

    that's not the order

    class AFX_EXT_CLASS C3dWorld : public CObject
    {
    DECLARE_DYNAMIC(C3dWorld);
    ......
    C3dObject* Import3dmax3DS(LPCSTR lpszFileName, BOOL bAddToList=TRUE);
    ......
    }

    C3dObject* C3dWorld::Import3dmax3DS(LPCSTR lpszFileName, BOOL bAddToList)
    {
    ......
    }


    C3dObject* pObject = m_pWorld->Import3dmax3DS(szPath, FALSE);


  • which situation does'error C2039' happen?