Hi everyone, this is the first time I post on this forum and I need a little help.
I've been messing around with SFML for a month now and I wanted my entities to inherit the draw function from sf::Drawable (as seen on the Vertex Array tutorial page) ò.ò
Here's a minimal example of the class:
Entity.h
#include <SFML/Graphics.hpp>
#ifndef ENTITY_H
#define ENTITY_H
class Entity : public sf::Drawable
{
public:
Entity();
sf::Texture Texture;
sf::Sprite Sprite;
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
};
#endif
Entity.cpp
#include "Entity.h"
Entity::Entity()
{
Texture.loadFromFile("Flashlight.png");
Sprite.setTexture(Texture);
}
The error I get:
undefined reference to `vtable for Entity'
My IDE is Code::Blocks and the SFML libreries are dinamically linked.
Thanks for you attention ^^