syntax error : missing ';' before identifier

4002 단어
원문 솔루션
#include "string.h"
#include "stdafx.h"
#include "Chapter 01 MyVersion.h"
#include "cGameError.h
class cGameError
{
    string m_errorText; public: cGameError( char *errorText ) { DP1("***
*** [ERROR] cGameError thrown! text: [%s]
***
", errorText ); m_errorText = string( errorText ); } const char *GetText() { return m_errorText.c_str(); } }; enum eResult { resAllGood = 0, // function passed with flying colors resFalse = 1, // function worked and returns 'false' resFailed = 1, // function failed miserably resNotImpl = 2, // function has not been implemented resForceDWord = 0x7FFFFFFF };

 
해결 방안: include 교체 include "string.h"
c++에서 include "string.h"는 표준 C의 헤더 파일입니다
c++ 헤더 파일입니다.string 클래스를 정의했습니다.
이름공간을 지정하는 방식으로string 클래스를 사용할 수도 있습니다.
std::string m_errorText;

혹은 사용을 통해
using namespace std;

당신의 서류 위쪽 어딘가에서 그것을 성명하기;

좋은 웹페이지 즐겨찾기