Dev - C++ - Por que me sale este error en un proyecto de C++

 
Vista:

Por que me sale este error en un proyecto de C++

Publicado por Mike (1 intervención) el 27/10/2017 00:30:35
Buenas gente, resulta que estoy trabajando en un proyecto que consiste en utilizar listas enlazadas o ligadas, el problema es que cuando quiero crear un nodo doblemente enlazado me sale el siguiente error:

studentNode.h|numero_linea|error: 'Student' does not name a type

Siempre que quiero declarar una variable tipo puntero Student, me sale el error, aquí les dejo las librerías que hice

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
///clase Student
 
#ifndef STUDENT_H_INCLUDED
#define STUDENT_H_INCLUDED
 
#include<iostream>
#include<string>
 
#include "name.h"
#include "data.h"
#include "SubjectList.h"
 
using namespace std;
 
class Student {
    private:
        std::string code;
        Name name;
        Date dataOfBirth;
        std::string career;
        Date dateOfAdmission;
        float grade;
        SubjectList subjectList; ///instancia de clase
 
    public:
        Student();
        Student(const Student&);
 
        std::string getCode();
        Name getName();
        Date getDateOfBirth();
        std::string getCareer();
        Date getDateOfAdmission();
        float getGrade();
        SubjectList& getSubjectList();
 
        void setCode(const std::string&);
        void setName(const Name&);
        void setDateOfBirth(const Date&);
        void setCareer(const std::string&);
        void setDateOfAdmission(const Date&);
        void setGrade(const float&);
        void setSubjectList(const SubjectList&);
 
        std::string toString(bool);
 
        void writeToDisk(const std::string&);
        void readFromDisk(const std::string&);
 
        Student& operator = (const Student&);
 
        bool operator == (Student&);
 
        friend std::ostream& operator << (std::ostream&, Student&);
        friend std::istream& operator >> (std::istream&, Student&);
 
    };
 
#endif // STUDENT_H_INCLUDED
 
///clase StudentNode
 
#ifndef STUDENTNODE_H_INCLUDED
#define STUDENTNODE_H_INCLUDED
 
#include "student.h"
 
class StudentNode {
    private:
        Student *dataPtr;
        StudentNode *prev;
        StudentNode *next;
 
    public:
        StudentNode();
        StudentNode(const Student&);
 
        Student *getDataPtr();
        Student& getData();
        StudentNode *getPrev();
        StudentNode *getNext();
 
        void setDataPtr(const Student*);
        void setData(const Student&);
        void setPrev(StudentNode*);
        void setNext(StudentNode*);
 
    };
 
#endif // STUDENTNODE_H_INCLUDED

///No se porque me dice 'Student' does not name a type" si se supone que ya lo cree, en total hice 12 librerías pero creo que el problema se encuentra en las dos que puse, gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

Por que me sale este error en un proyecto de C++

Publicado por juan carlos (7 intervenciones) el 30/10/2017 05:17:57
Hola ,me parece que el Student no tendrias que ponerlo como puntero sino ponerlo como variable ese atributo. es decir Student dataPtr . es decir dataPtr es de tipo Student
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar