C++ 可能是错误的构造函数,不确定类未被识别的原因

C++ 可能是错误的构造函数,不确定类未被识别的原因,c++,class,constructor,scope,C++,Class,Constructor,Scope,所以对于类,我们将使用从模板类列表派生的模板类集合来执行集合操作。当我编译时,编译器会抱怨集合没有在当前范围内声明。显然,我在cpp中包含了Set的.h文件和List的.h文件。我觉得我可能在某种程度上弄糟了构造器,但我不知道到底是什么错了。非常感谢您的任何见解 编译器投诉: p07.cpp: In function ‘void SetMgr(std::istream&, std::istream&, std::istream&, std::ostream&a

所以对于类,我们将使用从模板类列表派生的模板类集合来执行集合操作。当我编译时,编译器会抱怨集合没有在当前范围内声明。显然,我在cpp中包含了Set的.h文件和List的.h文件。我觉得我可能在某种程度上弄糟了构造器,但我不知道到底是什么错了。非常感谢您的任何见解

编译器投诉:

p07.cpp: In function ‘void SetMgr(std::istream&, std::istream&, std::istream&,       std::ostream&)’:
p07.cpp:43:2: error: ‘Set’ was not declared in this scope
p07.cpp:43:6: error: expected primary-expression before ‘int’
p07.cpp:43:6: error: expected ‘;’ before ‘int’
p07.cpp:44:2: error: ‘s1’ was not declared in this scope
p07.cpp:47:6: error: expected primary-expression before ‘int’
p07.cpp:47:6: error: expected ‘;’ before ‘int’
p07.cpp:48:2: error: ‘s2’ was not declared in this scope
p07.cpp:51:6: error: expected primary-expression before ‘int’
p07.cpp:51:6: error: expected ‘;’ before ‘int’
p07.cpp:52:2: error: ‘s3’ was not declared in this scope
p07.cpp:55:6: error: expected primary-expression before ‘int’
p07.cpp:55:6: error: expected ‘;’ before ‘int’
p07.cpp:56:2: error: ‘I’ was not declared in this scope
p07.cpp:60:6: error: expected primary-expression before ‘int’
p07.cpp:60:6: error: expected ‘;’ before ‘int’
p07.cpp:61:2: error: ‘U’ was not declared in this scope
p07.cpp:65:6: error: expected primary-expression before ‘int’
p07.cpp:65:6: error: expected ‘;’ before ‘int’
p07.cpp:66:2: error: ‘D’ was not declared in this scope
p07.cpp包括:

#include <cstdlib> 
#include <cstring> 
#include <iostream> 
#include <fstream> 
#include <string> 
#include <limits.h>

using namespace std; 

#include "List07.h"
#include "Set07.h"
Set07.h包括List07.h、类声明和构造函数:

#ifndef List07_h
#define List07_h 1
#include <cstdlib> 
#include <cstring> 
#include <iostream> 
#include <fstream> 
#include <string> 
#include <limits.h>

#include "List07.h"

template <class T>
class Set <T> public: List<T> {

public:
    Set(T m):List<T>(m, sz){}
    Set(T m, istream& i, ):List<T>(m, i){}
    ~Set(){~List();}

};
#endif
\ifndef列表07\u h
#定义列表07_h 1
#包括
#包括
#包括
#包括
#包括
#包括
#包括“List07.h”
模板
类集公共:列表{
公众:
集合(tm):列表(m,sz){}
Set(tm,istream&i,):List(m,i){
~Set(){~List();}
};
#恩迪夫
您应该更改(文件Set07.h):

例如:

#ifndef Set07_h
#define Set07_h
祝你好运

#ifndef List07_h
#define List07_h 1
#include <cstdlib> 
#include <cstring> 
#include <iostream> 
#include <fstream> 
#include <string> 
#include <limits.h>

#include "List07.h"

template <class T>
class Set <T> public: List<T> {

public:
    Set(T m):List<T>(m, sz){}
    Set(T m, istream& i, ):List<T>(m, i){}
    ~Set(){~List();}

};
#endif
#ifndef List07_h
#define List07_h 1
#ifndef Set07_h
#define Set07_h