So as the title states im receiving some odd errors with a couple of class that im working on. Im trying to implement the Entity Component System example from Game Programming Gems 6 and im getting a lot of issues with it from just doing test compiles every once in a while to check for syntax errors and such.
These classes are without definitions yet but I don't think that would be an issue.
#pragma once
#include <string>
#include <map>
#include "Component.h"
class GameObject
{
public:
GameObject(const std::string GameObjectID);
virtual ~GameObject()=0;
const std::string GetID();
void ClearComponents();
private:
std::string mGameObjectID;
std::map<const std::string, Component*> ComponentTable;
};
#pragma once
#include <string>
#include "GameObject.h"
class Component
{
public:
Component();
virtual ~Component()=0;
virtual const std::string componentID() const = 0;
virtual void Update();
void SetOwner(GameObject* go);
GameObject* GetOwner() const;
private:
GameObject* mOwner;
};
Warning 4 warning C4183: 'GetOwner': missing return type; assumed to be a member function returning 'int' c:\users\\code\c++\engine\engine\component.h 16 1 Engine
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\\code\c++\engine\engine\component.h 16 1 Engine
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\\code\c++\engine\engine\component.h 19 1 Engine
Error 9 error C2143: syntax error : missing ';' before '}' c:\users\\code\c++\engine\engine\gameobject.h 18 1 Engine
Error 11 error C2143: syntax error : missing ';' before '}' c:\users\\code\c++\engine\engine\component.h 20 1 Engine
Error 12 error C2143: syntax error : missing ';' before '}' c:\users\\code\c++\engine\engine\component.cpp 12 1 Engine
Error 10 error C2143: syntax error : missing ';' before '{' c:\users\\code\c++\engine\engine\component.h 6 1 Engine
Error 2 error C2143: syntax error : missing ';' before '*' c:\users\\code\c++\engine\engine\component.h 16 1 Engine
Error 5 error C2143: syntax error : missing ';' before '*' c:\users\\code\c++\engine\engine\component.h 19 1 Engine
Error 7 error C2065: 'Component' : undeclared identifier c:\users\\code\c++\engine\engine\gameobject.h 17 1 Engine
Error 1 error C2061: syntax error : identifier 'GameObject' c:\users\\code\c++\engine\engine\component.h 15 1 Engine
Error 8 error C2059: syntax error : '>' c:\users\\code\c++\engine\engine\gameobject.h 17 1 Engine
Error 13 error C1004: unexpected end-of-file found c:\users\\code\c++\engine\engine\component.cpp 12 1 Engine