Hello everyone. I am currently using Code::Block 20.03 and C++ 17.I have been using SFML for nearly 3 months. I found Laurent's book "SFML Game Development" one week ago. So in page 63 there is code lines look like this:
"
Aircraft::Aircraft(Type type, const TextureHolder& textures):
mType(type), mSprite(textures.get(toTextureID(type)))
{
}
"
I made console project, linked to SFML library.
I use .hpp files for headers and .cpp files for either main or class function definitions, I do not use .inl files.
But as soon as I compile it said
"
D:\2.Tin\Project\Plane_shooter\Aicraft.cpp|20|undefined reference to `ResourceHolder<sf::Texture,
Textures::ID>::get(Textures::ID) const'|
||error: ld returned 1 exit status|
"
This is in the file "Aircraft.cpp". Following are #include of the files:
Aircraft.cpp : #include "Aircraft.hpp"
Aircraft.hpp : #include "ResourceHolder.hpp" (template class for storing resources such as fonts, textures, ... It has a public member function "template <typename Resource, typename Identifier> const Resource& get(Identifier id) const"
#include "ResourceIdentifiers.hpp" (which consists a namespace Textures {enum class ID{...} };
Can you help me? I do not think i can figure out the problem myself.
Im sorry i uploaded this post in general but i think its just something to do with graphics module since I have not dealt with others.
Any help and comment would be appreciated, thank you.