hey, yeah I have included <SFML/Graphics.hpp>, but that's not what my issue is. My issue is that in the book/tutorial they make a namespace Textures, an enum for storing ids to later refer to textures. Its the part Textures::ID that causes the error that stops the program from compiling. And I'm not sure how I'm supposed to access the namespace from within that header file, having only declared the namespace in the main.cpp.
here is my code:
TextureHolder (where the error is):
#pragma once
#include <map>
#include <string>
#include <memory>
#include <stdexcept>
#include <cassert>
#include <SFML/Graphics.hpp>
class TextureHolder
{
private:
std::map <Textures::ID, std::unique_ptr<sf::Texture>> mTextureMap;
};
Main.cpp (where the namespace and enum are created):
#include <SFML/Graphics.hpp>
#include "Game.h"
namespace Textures
{
enum ID
{
starfield,
ship,
laser
};
}
int main()
{
Game game;
game.run();
return 0;
}
Other than that there is the game class - header and cpp - but I don't believe they hold any relevance to this.