So I am creating a header file to be used in my .cpp source files. The header file is done correctly (appears to be) and if I include it and use it in just one source file it works fine, but as soon as I include the header file in two source files (one having main function and the other containing the rest of the functions)I get an error.
The error you are getting is right. Only your main function should have the function definitions the other file code should just contain the functions.
No you can have header files included in multiple files. I believe the issue is your header guards.
generally they are just #ifndef STRUCTURES_H your final underscore included shouldn't be there
I would think thats your problem but i also just tested it on g++ and g++ allows it either way. what compiler are you using?
what is the exact error you get?
i figured it out i think. its because your creating an instance of the structs right after you declare them so it ends up trying to create multiple structs called name or equip.
i edited my above post. its simply because you create an instance of the structs right after you declare them in the header file so you end up with multiple structs named name or equip.
Thank yo for your help so far, and being patient...I am still very new to c++ so what do you mean by "create an instance of the structs right after you declare them"? Maybe because its late...but im not quite understanding.