Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error C2065? But I have my class declared!  (Read 1069 times)

0 Members and 1 Guest are viewing this topic.

JunkerKun

  • Newbie
  • *
  • Posts: 35
    • View Profile
Error C2065? But I have my class declared!
« 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.
« Last Edit: January 09, 2013, 09:58:38 pm by JunkerKun »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10835
    • View Profile
    • development blog
    • Email
Re: Error C2065? But I have my class declared!
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/