C++ compile error: has initializer but incomplete

2019-04-03 00:44发布

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条回答
霸刀☆藐视天下
2楼-- · 2019-04-03 01:41

You need this include:

#include <sstream>
查看更多
登录 后发表回答