Extern Struct?
<p>I'm using extern to fetch variables from another class, and it works fine for int's, float's etc...</p>

<p>But this doesn't work, and I don't know how to do it:</p>

<p>Class1.cpp</p>

<pre><code>struct MyStruct {
 int x;
}

MyStruct theVar;
</code></pre>

<p>Class2.cpp</p>

<pre><code>extern MyStruct theVar;

void test() {
 int t = theVar.x;
}
</code></pre>

<p>It doesn't work because Class2 doesn't know what MyStruct is.</p>

<p>How do I fix this? :/</p>

<p>I tried declaring the same struct in Class2.cpp, and it compiled, but the values were wrong.</p>
