title: 'Undefined reference to Class::method()'
body: <p>Recently I've been learning how to create methods within classes so that I only have to write a method once and for each of that class I instantiate I can call the one method and it will work only on the variables of the object that called it, I know how to do this when only using main.cpp and no headers however I am confused on how I should be writing this when I use a class header and cpp.<br>
  I have a sample of code similar to what I want to achieve:  </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace::std;
  
  class Object
  {
  public:
      int stuff;
      void manageStuff();
      Object();
  };
  void Object::manageStuff()
  {
      stuff++;
  }
  
  Object::Object() : stuff(0) {}
  
  Object object1, object2;
  
  int main() {
    for (int i = 0; i &lt; 10; i++)
    {
        object1.manageStuff();
        object2.manageStuff();
        cout &lt;&lt; object1.stuff &lt;&lt; "\n";
        cout &lt;&lt; object2.stuff &lt;&lt; "\n";
    }
  }  
  </code></pre>
  
  <p>This works fine and allows me to have two instances of Object and a method that works independently for each instance, this is my current project:<br>
  main.cpp:  </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Test.h"
  
  using namespace std;
  
  int main()
  {
  
      Test test;
  
      for (int i = 0; i &lt; 10; i++)
      {
          test.count(); // Here's my error "undefined reference to Test::count"
      }
  
      return 0;
  }  
  </code></pre>
  
  <p>Test.cpp  </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Test.h"
  
  using namespace std;
  
  Test::Test()
  {
      //ctor
  }
  
  Test::~Test()
  {
      //dtor
  }  
  </code></pre>
  
  <p>Test.h</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #ifndef TEST_H
  #define TEST_H
  
  
  class Test
  {
      public:
          Test();
          virtual ~Test();
          void count();
          int counter();
  };
  
  #endif // TEST_H  
  </code></pre>
  
  <p>and finally TestFunctions.h  </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Test.h"
  
  #ifndef TESTFUNCTIONS_H_INCLUDED
  #define TESTFUNCTIONS_H_INCLUDED
  
  void Test::count()
  {
      Test::counter++;
      std::cout &lt;&lt; Test::counter;
  }
  
  #endif // TESTFUNCTIONS_H_INCLUDED  
  </code></pre>
  
  <p>I'm sure that there will be something that's very obviously wrong to a more seasoned programmer and I'm about to look a bit thick but any help would be greatly appreciated<br>
  Thanks!</p>