Each file that #include
s the header file will have its own definition of the objects. That's why there are multiple definitions.
Instead, you should declare the objects as extern
in the header, and then have a single .cpp
file that contains those definitions. The extern
says "This is just a declaration. The object will be defined elsewhere."