My code is raising this error:
supportCrew.cpp:(.text+0x15): undefined reference to `sportsPsychologist::sportsPsychologist()'
supportCrew.cpp:(.text+0x25): undefined reference to `Physiotherapist::Physiotherapist()'
supportCrew.cpp:(.text+0x35): undefined reference to `trainer::trainer()'
supportCrew.cpp:(.text+0x47): undefined reference to `trainer::trainer()'
The two relevent classes/cpp files are supportCrew and Person
Person.cpp
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <chrono>
#include <random>
#include <algorithm>
Person::Person(std::string pName, int pAge, int pExperience) {
name = pName;
age = pAge;
experience = pExperience; //years of experience
};
Athlete::Athlete(std::string name, int age, int experience, std::string gender, double height, double weight)
{
gender = gender;
height = height;
weight = weight;
};
Physiotherapist::Physiotherapist(std::string name, int age, int experience, int recovery, int readiness) {
readinessScore = readiness;
recoveryScore = recovery;
};
sportsPsychologist::sportsPsychologist(std::string name, int age, int experience, int pressure, int injury, int successFail) {
pressurescore = pressure;
injuryscore = injury;
successfailscore = successFail;
};
trainer::trainer(std::string name, int age, int experience,std::string specialization, int performance, int consistency) {
specialization = specialization;
performanceScore = performance;
consistencyScore = consistency;
};
Person.h
#ifndef PERSON
#define PERSON
class Person {
std::string name;
int experience; //in years
int age;
public:
Person(std::string pName, int pAge, int pExperience);
Person();
virtual ~Person(){};
std::string getName() {return randomName();};
int getAge(){return randomAge();};
int getExperience(){return randomExperience();};
void printData(std::string, int, int);
std::string randomName();
int randomAge();
int randomExperience();
};
class Athlete: public Person{
private:
std::string gender;
double height;
double weight;
public:
Athlete(std::string pName, int pAge, int pExperience, std::string gender, double height, double weight);
Athlete();
virtual ~Athlete(){};
std::string &getGender(){return gender;};
std:: string randomGender();
double randomHeight();
double randomWeight();
};
class Physiotherapist: public Person{
private:
int recoveryScore;
int readinessScore;
public:
Physiotherapist(std::string pName, int pAge, int pExperience, int recoveryScore, int readinessScore);
Physiotherapist();
int &getscoreRecovery(){return recoveryScore;};
int &getscoreReadiness(){return readinessScore;};
};
class sportsPsychologist: public Person {
private:
int pressurescore;
int injuryscore;
int successfailscore;
public:
sportsPsychologist(std::string pName, int pAge, int pExperience, int pressureScore, int injuryScore, int successfailScore);
sportsPsychologist();
int &getscorePressure(){return pressurescore;};
int &getscoreInjury(){return injuryscore;};
int &getscoreSuccues_Fail(){return successfailscore;};
};
class teamManager: public Person {
public:
teamManager(std::string pName, int pAge, int pExperience);
teamManager();
};
class trainer: public Person {
private:
std::string specialization;
int performanceScore;
int consistencyScore;
public:
trainer(std::string pName, int pAge, int pExperience, std::string specialization, int performanceScore, int cocsistencyScore);
trainer();
std::string &getSpecialization(){return specialization;};
int &getscorePeformance(){return performanceScore;};
int &getscoreConsistency(){return consistencyScore;};
};
#endif
supportCrew.h
#ifndef SUPPORTCREW
#define SUPPORTCREW
#include "Person.h"
class supportCrew {
private:
sportsPsychologist Psychologist;
Physiotherapist physio;
trainer trainer1;
trainer trainer2;
public:
supportCrew(sportsPsychologist,Physiotherapist,trainer,trainer);
supportCrew();
};
#endif
supportCrew.cpp
#include <iostream>
#include <sstream>
#include <fstream>
#include "compDay.h"
#include "Competion.h"
#include "Events.h"
#include "Location.h"
#include "Octathlon.h"
#include "Person.h"
#include "supportCrew.h"
#include "theTeam.h"
#include "weatherSystem.h"
supportCrew::supportCrew() {
}