I have multiple C++ classes in a Pacman Game project (Maze, Food, Pacman, ...). I made a namespace 'Pacman_AI' so that the classes can be seen every where in the project. However, I got an error for 'GameObject' class: "name followed by '::' must be a class or namespace name".
Here is my "GameObject.cpp" in which I get the error above:
namespace Pacman_AI{
vector <pair <int, int> > GameObject::getPoints(){
return points;
}
string GameObject::getType(){
return type;
}
}
I already defined my "GameObject" class in a different file "GameObject.h".
Your help is highly appreciated.