Hi there,
I compiled sf 2.0 using visual studio 2010, and I went to #include <SFML\Graphics\Sprite.hpp> which gets loaded correctly.
When I compile my program (with this file being included) I get the following errors:
c:\sfml 2.0\include\sfml\system\resourceptr.inl(60): error C2027: use of undefined type 'sf::Texture'
2> c:\sfml 2.0\include\sfml\graphics\renderer.hpp(42) : see declaration of 'sf::Texture'
2> c:\sfml 2.0\include\sfml\system\resourceptr.inl(58) : while compiling class template member function 'sf::ResourcePtr<T>::~ResourcePtr(void)'
2> with
2> [
2> T=sf::Texture
2> ]
2> c:\sfml 2.0\include\sfml\graphics\sprite.hpp(207) : see reference to class template instantiation 'sf::ResourcePtr<T>' being compiled
2> with
2> [
2> T=sf::Texture
2> ]
2>c:\sfml 2.0\include\sfml\system\resourceptr.inl(60): error C2227: left of '->Disconnect' must point to class/struct/union/generic type
2>
2>Build FAILED.
I will post the file, just for completeness (it is small). Currently I have every instance of the sprite i want to initialize commented out, so I'll leave it like that.
#ifndef _SPRITECOMPONENT_HPP_
#define _SPRITECOMPONENT_HPP_
#include <string>
#include <SFML\Graphics\Sprite.hpp>
#include "../System/IComponent.hpp"
#include "../System/ISystemLog.hpp"
namespace Components
{
class SpriteComponent : public IComponent
{
public:
SpriteComponent(const sf::Sprite sprite) : IComponent("Sprite")//, _sprite(sprite)
{
}
~SpriteComponent() { }
/*const sf::Sprite GetSprite() const
{
return _sprite;
}*/
// abstract overrides
void SetProperties(std::map<std::string, boost::variant<int, std::string> > properties)
{
//_sprite = boost::get<sf::Sprite>(properties["sprite"]);
}
void Update() { }
private:
//sf::Sprite _sprite;
};
}
#endif
I'm running windows 7, with visual studio 2010. I am developing in C++.
Does anyone see anything that would point to why it thinks sf::Texture is undefined??
Thanks,
Short