SFML community forums

Help => General => Topic started by: JunkerKun on January 09, 2013, 09:54:04 pm

Title: Error C2065? But I have my class declared!
Post by: JunkerKun on January 09, 2013, 09:54:04 pm
So, I have this class:

#pragma once

#include "ObjectManager.h"
#include <map>
#include <string>

class Layers {
public:
        Layers();
        ~Layers();
        std::map<std::string,ObjectManager *> * layers;
        void AddLayer(std::string str);
        ObjectManager * GetLayer(std::string str);
};

And it VS gives me error C2065: "error C2065: 'ObjectManager' : undeclared identifier"
But as you can see, I am including header and there is no reason for this error to occur. Right?.. Right?

Update: Guh. Nevermind, it's just me being stupid.
Title: Re: Error C2065? But I have my class declared!
Post by: eXpl0it3r on January 09, 2013, 10:02:01 pm
Why did you post that under the C binding, when it's clearly C++ and doesn't even utilize SFML (at least not in the way to short code snippet)... ::)

Are you sure you want to has a pointer to a std::map which has a string-key associated with a ObejectManager pointer? ???
This seems like a very bad code design. You should probably take a look at smart pointers.

As for the problem, we can't really say what it is, since you didn't provide enough information.