2013-05-06 5 views
1

정말 이상한 문제가 있습니다. 나는 이런 식으로 선언 한 cpp에있는C++ : 구문 오류 C2061 : 식별자

void WriteMap(FILE *outfile,clsMapping &uMap); 

:

void CCompiler::WriteMap(FILE *outfile,clsMapping &uMap) 
{ 
    int iSize = uMap.Content().size(); 
    fwrite(&iSize,sizeof(int),1,outfile); 

    int iOffset=uMap.iOffset; 

    fwrite(&iOffset,sizeof(int),1,outfile); 

    vector<udtMapping>::iterator it = uMap.Content().begin(); 
    int n = 0; 
    for (;it != uMap.Content().end(); ++it) 
    { 
     fwrite(&it->ByteStart, sizeof(int), 1, outfile); 
     fwrite(&it->ByteCount, sizeof(int), 1, outfile); 
    } 
} 

컴파일러는 나에게 "구문 오류를 알려줍니다 내 헤더"compier.h "나는 다음과 같은 프로토 타입을 가지고에서

C2061 : 식별자 'clsMapping'. 그리고 내게 알려줍니다 :

선언은 ""void CCompiler :: WriteMap (FILE * outfile, & uMap) "("m : \ app \ compiler.h "의 30 행에 선언되어 있습니다)". 내가 오타를 바라나요 compiler.h에서

class clsMapping 
{ 
private: 
    vector<udtMapping> m_content; 

protected: 

public: 
    vector<udtMapping> &Content(); 
    void Add(int i1, int i2); 
    int iOffset; 
    void FeedFeaturesFromMap(udtFeatures &uFeatures,int uIndex); 
}; 

내가

#include "structures.h" 

을 언급 한, 또는 더 심각한 무언가이다 :

clsMapping은 "structures.h"헤더에 선언?

도움 주셔서 감사합니다.

+0

'clsMapping'이 클래스입니까? 이 파일에 분명히 선언했거나 선언을 포함 시켰습니까? – Rup

+0

그 이상의 오류가 있습니까? –

+4

** ** 어디에서 ** 오류를보고합니까? 'clsMapping'이 선언 된 곳은 어디입니까? – Angew

답변

0
#include "structures.h" 

을 cpp 및 h 파일에 모두 추가해야합니다.

관련 문제