살아가는 이야기

C++ 컴파일 오류(error): variable 'std::istringstream sstream' has initializer but incomplete type 본문

컴퓨터, 풀어그림

C++ 컴파일 오류(error): variable 'std::istringstream sstream' has initializer but incomplete type

우균 2016. 12. 8. 12:53

제목이 조금 복잡하긴 하지만 오류를 그대로 넣은 것이다. 오류를 자세히 읽어 보면 아래와 같은 뜻이다.

error: variable 'std::istringstream sstream' has initializer but incomplete type
오류: 'std::istringstream sstream' 변수가 초기화 리스트를 이용하고 있지만 불완전 타입임

이유는 std::istringstream sstream이 클래스 선언만 되어 있고 정의가 없기 때문이다. 따라서 아래 #include 문을 추가하면 된다.

#include <sstream>


이것 하나 때문에 엄청난 오류를 때리다니... ㅠㅠ

Comments