Class Errors (LNK2005)

This is a discussion on Class Errors (LNK2005) within the C++ Programming forums, part of the General Programming Boards category; I'm getting errors while trying to compile code using 2 classes, box and player. While looking for help online, I ...

Class Errors (LNK2005)

I'm getting errors while trying to compile code using 2 classes, box and player. While looking for help online, I got the feeling that this is a fairly common problem, or the solution is at least obvious to the experienced programmer. Any help?

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens

What are you attempting to do with the posX you declare in the cpp files? If it is an attempt at initializing the member posX to a default value in the classes, it won't work the way you have it. That should be done in the constructor using an initializing list like this.