<p>there was a somewhat detailed thread (228684) on how to globally (using extern struct) declare a structure that could be seen in more than 1 c++ file, but I can not figure out exactly how to do it (there was a lot of discussion about do this, do that, maybe do this, try this, etc...). </p>

<p>couuld someone please post a very simple example of how to declare a structure that could be seen in 2 separate c++ files?  If I put all my functions in the same file as the main it works fine, but when I try to split the functions out in different files I cannot get it to compile. </p>

<p>Things I am unclear on...
Should I typedef the structure?
Do I define the structure in a header file and include that header in each c++ source file?
Do I need the #ifndef macro in the header file?
Do I declare the structure extern in the header?</p>

It's called a header file.
in your header file (call it foo.h)
```
```
#ifndef FOO_H
#define FOO_H
class X {
};
#endif
```
```
Then, in any C files you have
```
```
#include "foo.h"
X x;
```
```
For C++ it's more common/preferred to use class, but you can use struct as well.  The extern keyword generally refers to variables, not class/struct declarations.  You would make a global variable extern in a header file (then declare it not-extern) in one of your .cpp files.