title: C++ variable has initializer but incomplete type?
body: <p>I am trying to compile 2 classes in C++ with the following command:</p>
  
  <p><code>g++ Cat.cpp Cat_main.cpp -o Cat</code></p>
  
  <p>But I receive the following error:</p>
  
  <p><code>Cat.cpp:10:10: error: variable ‘Cat Joey’ has initializer but incomplete type</code></p>
  
  <p>Could someone explain to me what this means? What my files basically do is create a class (<code>Cat.cpp</code>) and create an instance (<code>Cat_main.cpp</code>). Here is my source code:</p>
  
  <p><strong>Cat.cpp:</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  class Cat;
  
  using namespace std;
  
  int main()
  {
      Cat Joey("Joey");
      Joey.Meow();
  
      return 0;
  }
  </code></pre>
  
  <p><strong>Cat_main.cpp:</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class Cat
  {
      public:
          Cat(string str);
      // Variables
          string name;
      // Functions
          void Meow();
  };
  
  Cat::Cat(string str)
  {
      this-&gt;name = str;
  }
  
  void Cat::Meow()
  {
      cout &lt;&lt; "Meow!" &lt;&lt; endl;
      return;
  }
  </code></pre>