2012-07-18 4 views
0

나는 "Missing '을 많이 보았습니다. 'x' '질문 이전에이 특정 문제에 대한 답을 찾지 못했습니다. 상술 한 바와 같이누락 ';' before '*'

// ---- Define File ---- 

#ifndef AnimDefinition_h 
#define AnimDefinition_h 

// ---- Include ---- 

#include "AString.h" 
#include "FileReader.h" 

// ---- Global Constant Variables ---- 

static const int MaxAnimations = 16; 
static const int Blank   = 10; 
static const int EndOfLine  = 59; 
static const int Space   = 32; 

// ---------------------------------------------------------------- 
//      Sprite Animation Definition      
// ---------------------------------------------------------------- 
class AnimDefinition 
{ 
private: 

    struct Animation 
    { 
     AString  mAnimationID; 
     AString  mLoopTo; 
     int   mFrameBegin; 
     int   mFrameEnd; 
    }; 

public: 

        AnimDefinition   (void); 
        AnimDefinition   (const char *pFileName); 
        ~AnimDefinition   (void); 

    void   ReadFile    (); 

    Animation*  Animation    (int pIndex); 
    Animation*  Animation    (const char *pFileName); // The first incident of this error occurs here 

private: 

    const char  *Scan     (char *pSource, int &pCounter); 

private: 

    AString   mDefinitionID; 
    FileReader  mFileReader; 
    Animation  *mAnimations[MaxAnimations]; 

    int    mNumberAnimations; 
}; 

// ---- End Definition ---- 

#endif // AnimDefinition_h 

는 I 오류 충돌되는 첫 번째 라인은 I가 AnimDefinition는 "AString.h"중 하나에 포함되거나되지 않는지 확인 하였다

Animation*  Animation    (const char *pFileName); 

함수의 정의는 "FileReader.h". 이 클래스들 중 어느 것도 세미콜론이없는 곳이 없습니다.

도움이 될 것입니다.

감사합니다.

+0

클래스와 동일한 이름의 메서드를 제공 할 수 없거나 생성자와 충돌합니다. –

+0

'getAnimation'? –

답변

7

Animationstruct이며 함수 이름으로 사용할 수 없습니다. 그냥 이름 바꾸기 :

Animation* someOtherNameForGettingAnimation(int pIndex); 
+0

사실, 할 수 있습니다. –

+0

@LuchianGrigore : 예? – Andrew

+0

신경 쓰지 마라, MSVS 다시 미쳤다 :) –

-3

이것은 매우 어리 석다.

내가 미리 정의한 실제 유형과 동일한 인터페이스 이름으로 함수를 정의 할 때 문제가 발생합니다.

이 줄 :

Animation*  Animation   (int pIndex); 

내가 분명히 잘못이 기능을 "애니메이션"라고했고, 나는 이후 지명 한 문제를 해결하기 위해 : 누구의 시간을 낭비하기위한

Animation*  GetAnimation   (int pIndex); 

미안 .

+3

이미 답변이 있습니다. 당신은 똑같은 말을 게시하는 대신에 그것을 받아 들여야합니다 (답의 왼쪽에있는 눈금 표시를 표시하십시오). –

+0

나는 다른 사람이 그의 대답을 게시하는 동안 대답을 게시했다. 내 친구를 공격적으로 공격 할 필요가 없습니다. –