【发布时间】:2012-11-05 20:40:44
【问题描述】:
我在 Eclipse 中编码,并且有如下内容:
#include <ftream>
#include <iostream>
void read_file(){
char buffer[1025];
std::istringstream iss(buffer);
}
但是,当我尝试构建时,出现以下错误:variable 'std::istringstream iss' has initializer but incomplete type
有什么快速的想法吗?我用谷歌搜索了一下,似乎大多数有这个问题的人根本没有包含正确的头文件,我相信我做得正确。
【问题讨论】:
-
std::istringstring?不过,它无论如何都在<sstream>标头中。 -
哎呀,我打错了问题,我按照你写的方式编码所以问题还是一样
-
是的,添加
使其构建正确,谢谢! -
很难看出重新打开的理由是什么。我会跳过并让其他人做出决定,但这似乎是一个简单的错误。
-
另外,我认为第一行应该是
#include<fstream>而不是#include <ftream>@Aneem
标签: c++ compilation istringstream