所以这显然不是真正的错误,但我不知道实际错误是什么,因为症状是如此模糊。我将在此处包含文件,你们告诉我您认为它可能在哪里以及是什么导致了未声明的标识符错误。
system.h(66): error C2065: 'EntityManager' : undeclared identifier
系统.h
/*******************************************************************************
filename: System.h
Author:
Date: November 13, 2010
********************************************************************************/
#ifndef SYSTEM_H
#define SYSTEM_H
#include <string>
#include <memory>
//The interfaces for the framework elements.
#include "I_OS.h"
#include "I_Graphics.h"
//The derived interface elements tailored to the platform.
#include "Windows_module.h"
#include "D3D11_module.h"
#include "EntityManager.h"
// ** AUTHOR NOTE ** temporary until ini file reading is implemented
#define FULL_SCREEN false
/*******************************************************************************
Purpose:
This will be the central object that is responsible for containing and
systematically initializing, updating per frame, and shutting down ALL the objects
responsible for the various internal workings of the framework. This will also
serve as the nexus for all external entities to retrieve data, interface with engine
elements, as well as interfacing between eachother.
********************************************************************************/
class System
{
public:
/* All framework elements and interfaces contain an Initialization context to be
created outside, filled out, and passed into the Initalize function. This is to
maintain polymorphic similar function declarations, while still having variable
parameters */
class InitializeContext
{
public:
HINSTANCE hinstance;
};
System();
~System();
bool Initialize(InitializeContext &);
void Run();
void Shutdown();
public:
//pointer declarations of interface types for each framework element
std::shared_ptr<I_OS> m_os;
std::shared_ptr<I_Graphics> m_graphics;
std::shared_ptr<EntityManager> m_EntityManager;
};
/* This will be the global pointer that all entities will use to access the
public interface pointers to the entire framework.
** AUTHOR NOTE ** : all entities should refer to the interfaces, and non platform
specific elements to maintain crossplatform compatibility, (if it can be avoided)*/
extern std::shared_ptr<System> g_System;
#endif
实体管理器.h
/*******************************************************************************
filename: EntityManager.h
Author:
Date: October 27, 2011
********************************************************************************/
#ifndef ENTITY_MANAGER_H
#define ENTITY_MANAGER_H
#include <vector>
#include <map>
#include <fstream>
#include <memory>
#include "EntityBase.h"
#include "EntityList.h"
/*******************************************************************************
Purpose:
This wil be the object responsible for managing and updating all the various Entities
currently rendered in a scene. It reads from a scene file and dynamically creates instances
of the objects listed to be stored in a vector. these objects can be accessed individually
by either index or unique string identifier, or you can obtain a vector that contains
objects of the same class type.
********************************************************************************/
class EntityManager
{
public:
bool Initialize();
bool Frame();
void Shutdown();
private:
BaseFactory m_factory;
std::vector <std::shared_ptr<BaseEntity> > m_EntityList;
std::map<std::string, std::shared_ptr<BaseEntity> > m_EntityByNameList;
std::map<std::string, std::vector<std::shared_ptr<BaseEntity> > > m_EntityByClassList;
};
#endif
那么这些导致 EntityManager 未声明有什么问题吗?这是输出中唯一的错误。认为您需要更多文件,我会包含它们。