You indeed have a problem.
The variables you declare (like
player1
,
player2
,
win1
,
win2
, ...) are declared every time you include that file. Can I assume it's globals.h or globals.hpp and
not globals.cpp?
Here's what you need to do.
1. Put your code into git, so you don't loose anything.
2. You need a header file with your declarations, and a separate source file with your definitions.
3. Let's call this file globals.hpp
4. Make sure the rest of your program is using globals.hpp for this file.
5. Copy all those object declarations to a globals.cpp, and just include globals.hpp at the top.
6. Move all the prototypes to the top of the file, under the #includes.
7. Put extern in front of those declarations and remove the initial values, to make them definitions.
For example:
becomes
8. Add globals.cpp to your build system (or however your app is compiled).
That's it!