C++ compile error: has initializer but incomplete type

孤者浪人 提交于 2019-12-20 15:36:17

问题


I am coding in Eclipse and have something like the following:

#include <ftream>
#include <iostream>

void read_file(){
    char buffer[1025];
    std::istringstream iss(buffer);
}

However, when I try to build, I get the following error: variable 'std::istringstream iss' has initializer but incomplete type

Any quick thoughts? I have googled around and it seems like most people with this problem simply did not include the right header files which I believe I am doing correctly.


回答1:


You need this include:

#include <sstream>


来源:https://stackoverflow.com/questions/13428164/c-compile-error-has-initializer-but-incomplete-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!