遺伝子配列決定プロジェクト用に 16 の異なるサフィックス ツリーを構築しようとしています。彼らはそのようにメインで構築されています
int main()
{
ifstream fp;
fp.open("filepath", ifstream::in);
Tree I(fp);
fp.close();
このコードを使用して、コンストラクターでそれらを使用しようとしています:
Tree::Tree(ifstream &fp)
{
string current = "";
char* line;
fp.getLine(line, 100); //ignore first line
for(int i=0; i<100; i++)
{
char temp = (char)fp.get();
if(temp=='\n')i--;
else current+=temp;
}
insert(current);
while(fp.good())
{
current = current.substr(1,99);
char temp = (char)fp.get();
if(temp=='\n')temp=(char)fp.get();
if(temp==EOF) break;
current+=temp;
insert(current);
}
}
コンパイルしようとすると、fp を使用するすべてのインスタンスで次のエラーが発生します。
suffix.cpp: コンストラクター内
Tree::Tree(std::ifstream&)
:
suffix.cpp:12: エラー: 未定義の型struct std::basic_ifstream<char, std::char_traits<char> >
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../includeの無効な使用/c++/4.1.2/iosfwd:89: エラー:struct std::basic_ifstream<char, std::char_traits<char> >
suffix.cpp:15 の宣言: エラー: 未定義の型の無効な使用struct std::basic_ifstream<char, std::char_traits<char> >
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../.. /../../include/c++/4.1.2/iosfwd:89: エラー: の宣言struct std::basic_ifstream<char, std::char_traits<char> >