First off, yes this is a university project, no I don't want you to write the program for me. This is a C++ project to write a game with the SDL libarary.
I have a problem with namespaces. for the project I need to separate my logical units from the part where I show them on the screen. I'm using the namespaces logic and visual to separate them. Now I need the Player class from the logic namespace to be the base class of the Player class in the visual namespace.
The visual::Player.h class looks like this:
#include "../logic/Player.h"
#ifndef PLAYER_H_
#define PLAYER_H_
namespace visual {
class Player : public logic::Player {
public:
Player();
virtual ~Player();
};
}
#endif /* PLAYER_H_ */
And the visual::Player.cpp file looks like this:
#include "Player.h"
namespace visual {
Player::Player() {
}
Player::~Player() {
}
}
Now I'm getting errors on the lines in the .cpp file:
Player::Player()
Multiple markers at this line
- ISO C++ forbids declaration of ‘Player’ with no
type
- ‘Player’ has not been declared
Player::~Player()
expected constructor, destructor, or type conversion before ‘::’ token