I'm aware this question has been asked numerous times but I've tried several suggestions such as checking my spelling, making sure I included the header files, capitalization, etc, but I'm still getting the same error and can't figure out what's triggering it.
When I try to compile Student.h using g++ -c Customer.h I get the error 'Student' does not name a type on the line 'Student student;' for Login.h and I have no idea why. Can anyone try to pinpoint what's causing it? This variable is supposed to represent the student of this login id/account which is supposed to be a pointer to a Student object.
Likewise, when I try to compile Login.h, I get the error 'Login' has not been declared in Customer.h for bool addAcct(Login*) as well as the error 'Login' does not have a type for Login* logins[MAX_LOGINS].
Any help would be appreciated!
Student.h:
#ifndef STUDENT_H
#define STUDENT_H
#define MAX_LOGINS 4
#include <string>
#include "Login.h"
using namespace std;
class Student{
public:
Student(int = 0, string = "");
int getId();
bool addAcct(Login*);
void print();
private:
int id;
string name;
Login* logins[MAX_LOGINS];
int numberOfLogins;
};
#endif
Login.h
#ifndef LOGIN_H
#define LOGIN_H
#include <string>
#include "Student.h"
using namespace std;
class Login{
public:
Login(int = 0, float = 0);
int getNumber();
void setStudent();
void print();
private:
int number;
Student student;
};
#endif