title: "Undefined reference to"
body: <p>I know that there are a lot of questions somewhat related to this one, but they answers are a bit hard for me to make sense of. I'm receiving the following error for a few different lines of code:</p>
  
  <pre><code>C:\Users\Jeff\AppData\Local\Temp\ccAixtmT.o:football.cpp:(.text+0x6f0): undefined 
  reference to `Player::set_values(int, std::string, float)'
  </code></pre>
  
  <p>From these blocks of code:</p>
  
  <pre><code>class Player {
  int playerNum;
  string playerPos;
  float playerRank;
  public:
      void set_values(int, string, float);
      float get_rank(){ return playerRank; };
      bool operator == (const Player &amp;p1/*, const Player &amp;p2*/) const
      {
      if(&amp;p1.playerNum == &amp;playerNum &amp;&amp;
         &amp;p1.playerPos == &amp;playerPos &amp;&amp;
         &amp;p1.playerRank == &amp;playerRank)
         return true;
      else
         return false; };
  };
  </code></pre>
  
  <p>And this being the main function referencing the subclass:</p>
  
  <pre><code>int main() {
  
  ifstream infile;
  infile.open ("input.txt", ifstream::in);
  int numTeams;
  string command;
  while(!infile.fail() &amp;&amp; !infile.eof()){
      infile &gt;&gt; numTeams;
      string name;
      Player p;
      int playNum;
      string playPos;
      float playRank;
      Player all[11];
      float ranks[11];
      Team allTeams[numTeams];
      for(int i=0; i&lt;numTeams; i++){
          infile &gt;&gt; name;
          for(int j=0; j&lt;11; j++){
              infile &gt;&gt; playNum;
              infile &gt;&gt; playPos;
              infile &gt;&gt; playRank;
              if(playPos == "QB")
                  p.set_values(playNum, playPos, (playRank*2.0));
              else if(playPos == "RB")
                  p.set_values(playNum, playPos, (playRank*1.5));
              else if(playPos == "WR")
                  p.set_values(playNum, playPos, (playRank/1.8));
              else if(playPos == "TE")
                  p.set_values(playNum, playPos, (playRank*1.1));
              else if(playPos == "GD")
                  p.set_values(playNum, playPos, (playRank/2.0));
              else if(playPos == "TC")
                  p.set_values(playNum, playPos, (playRank/2.2));
              else if(playPos == "CR")
                  p.set_values(playNum, playPos, (playRank/1.2));
              all[j] = p;
              allTeams[i].set_values(all, name);
          }
      }
      infile &gt;&gt; command;
      if (command == "play"){ 
          int t1;
          int t2;
          infile &gt;&gt; t1;
          infile &gt;&gt; t2;
          play(allTeams[t1], allTeams[t2]); 
      }
      else { 
          int t1;
          int p1;
          int t2;
          int p2;
          swap(allTeams[t1], allTeams[t1].get_player(p1), allTeams[t2], allTeams[t2].get_player(p2)); }
  }
  }
  </code></pre>