
29/11/2012, 14:34
|
| | Fecha de Ingreso: septiembre-2012
Mensajes: 38
Antigüedad: 12 años, 6 meses Puntos: 0 | |
error: invalid use of incomplete type 'struct Foo' Llevo analizando este error un rato y no veo donde falla. Estos son los errores que me da:
Código:
C:\Users\Héctor\Documents\Visual Studio 2010\Projects\GekkoEngine\src\Components\../../include/Cube.hpp:12: error: invalid use of incomplete type 'struct Component'
C:\Users\Héctor\Documents\Visual Studio 2010\Projects\GekkoEngine\src\Components\../../include/GameScreen.hpp:14: error: forward declaration of 'struct Component'
GameScreen
Código:
#ifndef GAMESCREEN_H
#define GAMESCREEN_H
#include <string>
#include <list>
#include <iostream>
#include <functional>
#include <algorithm>
#include "Util.hpp"
#include "object.hpp"
#include "Component.hpp"
class Engine;
class Component; // Line 14
class GameScreen : public object
{
public:
GameScreen(std::string);
void setEngine(Engine *engine);
Engine* getEngine(void);
void setName(std::string);
string getName(void);
void AddComponent(Component*);
void RemoveComponent(Component*);
void PutComponentInOrder(Component*);
void LoadGameScreen(void);
virtual void Draw(void);
virtual void Update(void);
// Sobrescribimos el operador == para poder hacer nuestra propia comparacion
// friend: no pertenece a la clase, pero puede usar sus miembros
friend bool operator == (const GameScreen &gs1, const GameScreen &gs2);
GameScreen& operator = (const GameScreen &gs);
protected:
virtual void Load(void);
private:
string name;
static Engine* engine;
std::list<Component*> components;
bool loaded;
};
struct CompareGS : public std::binary_function < GameScreen*, GameScreen*, bool>
{
bool operator() (const GameScreen* gs1, const GameScreen* value) const
{
return (gs1 == value);
}
};
#endif // GAMESCREEN_H
Cube
Código:
#ifndef CUBE_H
#define CUBE_H
#include "../glm/gtc/matrix_transform.hpp"
#include "../glm/gtc/type_ptr.hpp"
#include "../include/GraphicsUtil.hpp"
#include "Component.hpp"
#include "GameScreen.hpp"
class Cube : public Component
{ // Line 12
public:
Cube();
void Update(void);
void Draw(void);
protected:
void Initialize(void);
void Load(void);
private:
static Mesh* mesh;
static Shader* shader;
static GLuint
ShaderIds[3],
TextureId;
static GLuint ModelMatrixUniformLocation,
Tex0Loc;
static mat4 ModelMatrix;
};
#endif // CUBE_H
Última edición por ShotoReaper; 29/11/2012 a las 14:36
Razón: Añadir las lineas
|