2015-01-27 4 views

답변

3

컴파일러는 명시 적입니다 : 내가 컴파일 할 때

#include "lexer.h" 

Lexer::Lexer(std::istream& inputstream){ 

} 

, 나는 오류 메시지 : 아래 그림과 같이

#ifndef LEXER_H 
#define LEXER_H 

#include "token.h" 
#include <istream> 

class Lexer { 
    public: 
     Lexer(std::istream& input_stream); 
     Token next_token(); 
    private: 
     int current_line; 
     int current_column; 
     std::istream& input_stream; 
}; 

#endif 

내가 .cpp 파일을 만들기 시작했다 참조 멤버는 이어야하며 멤버 초기화 목록에으로 초기화되어야합니다.

Lexer::Lexer(std::istream& inputstream) : input_stream(inputstream) { 

} 
관련 문제