Hi. I'm with a big problem. I decided to divide my program in several source files, but i've never done it.
I had a Main.cpp file. Then I created two more source files (file1.cpp and file2.cpp). I divided the functions thematically, letting the main file only with the WinMain and the WndProc functions.
Then I created a Header file and I put there the Global Variables and the Function Prototypes.
All my source files must have access to the Global Variables but I don't know how I can do this.
If I #include the header file it presents a compiler error saying that I'm redifining the variables.
If I #include the header file only in the Main I get an error from the other source files complaining that they can't access the global variables.
If I create like a chain, this is: in the Main.cpp I #include the source1.cpp, in the source1.cpp I include source2 and there i include the header I also get an error.

This may seem like stupid but I would like to know how to do this(if it can be done).

Thanks.