title: Trying to start queue for tracking players turn
body: <p>I'm trying to start a queue for tracking players turn. There's a possibility of 8 players in the queue, so there should be 8 Player objects in the queue. The error I keep getting is <code>LNK2005 "public:_thiscall Player::Player(void)" (??0Player@@QAE@XZ) already defined in Main.obj</code> and also <code>LNK1169 one or more multiply defined symbols found</code>. The only answer I found online was to try making my getters inline, but that didn't really help. I also tried making 4 different Player objects without the loop and adding them individually, but that didn't fix anything either. Originally, the Player class was a template class, but I changed it because I didn't think it needed to be one and I was getting a different error when it was. Hopefully someone can give me a heads up as to what I'm doing wrong. The queue is a template though because I wanted to be able to store anything in my queue. So, first I initialized a queue.</p>
  
  <pre><code>//initialize players turn in queue
  Queue&lt;Player&gt; playerQueue(NUM_PLAYERS);
  
  //track players added
  int playerNum = 1;
  
  //keep looping until we reached 
  //the number of players
  while (playerNum &lt;= NUM_PLAYERS) {
  
      //create new object
      Player newPlayer;
      //add to queue
      playerQueue.add(newPlayer);
      //increment player count
      playerNum++;
  }
  </code></pre>
  
  <p>My player class at the moment is quite simple. The getters are commented out because at the moment they are inlined in the header file. Read that doing so could possibly fix my problem. It did not.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "player.h"
  #include "queue.h"
  using namespace std;
  
  Player::Player() {
  
      pName = "Outis";
      queuePos = 0;
      propSize = 0;
      currency = 0;
  }
  
  //Getters
  /*int Player::getCurrency() {
      return currency;
  }
  
  int Player::getQueuePos() {
      return queuePos;
  }*/
  </code></pre>
  
  <p>This is my header file</p>
  
  <pre><code> class Player {
  
  public:
      Player();
  
      //Getters
      inline int getCurrency() { return currency; }
      inline int getQueuePos() { return queuePos; }
      //vector&lt;Properties&gt; getProperties();
  
  private:
  
      //players name
      std::string pName;
  
      //when it is their turn
      int queuePos;
  
      //size of property vector
      int propSize;
      //vector to store properties
      //vector&lt;Properties&gt; propList;
  
      //amount of currency
      int currency;
  };
  </code></pre>
  
  <p>This is the add function in my Queue template class</p>
  
  <pre><code>// Add value to rear
  template&lt;class T&gt;
  void Queue&lt;T&gt;::add(const T &amp;val)
  {
      if (numStored == capacity)
      {
          cerr &lt;&lt; "Queue full: cannot add element" &lt;&lt; endl;
          return;
      }
  
      // add to rear
      int rearIndex = (frontIndex + numStored) % capacity;
  
      elements[rearIndex] = val;
      numStored++;
  
  }
  </code></pre>