Hello I am working on a project for school and the compiler in the terminal seems to be giving me the error 'undefined reference to my class. Does it have something to do with ctors and default ctors? Any suggestions on how to fix this? Thank you!
#include <iostream>
using namespace std;
class Sports{
public:
Sports();
Sports(int players, int medals = 0){
m_players = players;
m_medals = medals;
}
int getPlayers(){return m_players;}
bool getMedals(){return m_medals;}
friend bool compare(const Sports & lhs, const Sports & rhs){
return(lhs.m_players == lhs.m_players && rhs.m_medals == rhs.m_medals);
}
protected:
int m_players;
//private:
int m_medals;
};
class Tennis : public Sports{
public:
Tennis(bool experience){
m_experience = experience;
}
void RemovePlayers(){m_players--;}
void AddMedals(){m_medals++;}
private:
bool m_experience;
};
int main(){
Tennis t1;
return 0;
}