Hey everyone,
If I try to use my "Resource" class that's just based on sf::InputStream I do always get a bunch of compiler errors like:
-
error LNK2001: unresolved external symbol "public: virtual __int64 __thiscall engine::Resource::tell(void)" (?tell@Resource@engine@@UAE_JXZ)
- error LNK2001: unresolved external symbol "public: virtual __int64 __thiscall engine::Resource::getSize(void)" (?getSize@Resource@engine@@UAE_JXZ)
- error LNK2001: unresolved external symbol "public: bool __thiscall engine::Resource::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?open@Resource@engine@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)I'm using Visual Studio 2012 for Desktop and I'm using the 32bits version of SFML. Everything works fine, excepting the resource loading.
The preprocessor definition "SFML_STATIC" is set and I've linked the static libraries of SFML (sfml-audio-s.lib, sfml-graphics-s.lib, sfml-window-s.lib, sfml-network-s.lib, sfml-system-s.lib and sfml-main.lib).
I've just followed this tutorial:
http://www.sfml-dev.org/documentation/2.1/classsf_1_1InputStream.phpAnd that's how my class looks like:
class Resource : public sf::InputStream
{
public:
Resource(std::string archive);
public:
bool open(std::string file);
public:
sf::Int64 read(void* data, sf::Int64 size);
public:
sf::Int64 seek(sf::Int64 position);
public:
sf::Int64 tell();
public:
sf::Int64 getSize();
};
And that's how I use it:
Resource assets("Assets.era");
// ...
Image icon(assets, "Icon.png");
// ...
window.setIcon(32, 32, icon);
Thanks for any help.
Regards