Pourquoi j'obtiens l'erreur C2061 (erreur de syntaxe: identificateur)?

Bon... j'ai été la lutte de cette erreur au moins une heure maintenant. J'ai mon StaticSprite classe hérite de ma classe de Composant. Cependant, lorsque j'essaie d'instancier un StaticSprite exemple, j'obtiens l'erreur c2016.

Voici mon code, je vais poster plus si besoin.
Merci à l'avance.

StaticSprite.h

#ifndef STATICSPRITE_H_
#define STATICSPRITE_H_

#include "Component.h"
#include <SFML/Graphics.hpp>
#include <string>

namespace GE
{
 class Entity;
 class Component;
 class StaticSprite : public Component
 {
 private:
  sf::Image image;
 public:
  sf::Sprite Sprite;
  StaticSprite();
  StaticSprite(std::string filename);
 };
}

#endif

Composant.h

#ifndef COMPONENT_H_
#define COMPONENT_H_

#include "Entity.h"
#include "ComponentType.h"
#include <iostream>

namespace GE
{
 class Entity;
 class Component
 {
 protected:
  Entity* myEntity;
  TYPE type;
 public:
  Component();
  virtual ~Component() {}
  Entity* getEntity();
 };
}

#endif

main.cpp

int main(int argc, char* argv[])
{
    Entity Player;
    //The first arg is just a number, and the second is the 
    //actual component to add to the Entity's component array
    Player.addComponent(StaticSprite, new StaticSprite()); //error

    //application loop
}

Entity.cpp

//TYPE is just an enumerated type
void Entity::addComponent(TYPE type, void* component)
{
Components[type] = component;
}

ComponentType.h

#ifndef COMPONENTTYPE_H_
#define COMPONENTTYPE_H_

namespace GE
{
enum TYPE{Base = 0, StaticSprite, DynamicSprite, 
    Physics, Collision, Input, Particle, Audio, Scriptable, MaxType};  
}

#endif
  • Quelle ligne l'erreur correspondent à l'?
  • Pouvez-vous montrer comment vous l'instanciation de l'objet?
  • Qui ligne avez-vous l'erreur?
InformationsquelleAutor epicasian | 2010-11-21