So, I made two classes, in separate files, Enemy and Player. I included "Enemy.h" in Player.h and "Player.h" in Enemy.h. Then I declare void attack(Enemy) in Player.h, and it tells me that "Enemy has not been declared". I know that this code would not generate a compiler error in a different compiler, so I am confused about what is wrong with code::blocks. Any help?
It's not code::blocks that's the problem, this is a common issue to run into if you're not watching for it. The problem is that your Player.h file can't see your declaration of the "Enemy" class so it doesn't know how much space it needs to allocate for that variable. My favorite solution to this is to have a virtual parent class that both Player and Enemy inherit from, then instead of passing an Enemy object as an argument to your "attack" function you pass a pointer to the base class. Polymorphism is really cool once you start to use it.
EDIT: You'll also want some #ifndef blocks to prevent the compiler from seeing class redeclarations.