forward declaration of class in c++
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1885471/c-forward-declaration-of-class-doesnt-seem-to-work">C++: Forward declaration of class doesn&#39;t seem to work?</a>  </p>
</blockquote>



<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;


class BigObject;
using namespace std;
int main(int argc, char *argv[]) {
    BigObject one;

    string str = "this is a stirng";
    cout&lt;&lt;str;
}

class BigObject {
public:
    BigObject(){
        cout&lt;&lt;"big object \n";
    }
    virtual ~BigObject(){}      
};
</code></pre>

<blockquote>
  <p>Untitled.cpp:8:12: error: variable has incomplete type 'BigObject'</p>
  
  <p>BigObject one;</p>
  
  <p>^ Untitled.cpp:5:7: note: forward declaration of 'BigObject' class 
  BigObject;</p>
  
  <p>^ 1 error generated.</p>
</blockquote>

<p>Why this can't be compiled? </p>
