error LNK2001: unresolved external symbol "private: static class irrklang::ISoundEngine * GameEngine::Sound::_soundDevice" (?_soundDevice@Sound@GameEngine@@0PAVISoundEngine@irrklang@@A)
I cannot figure out why i am receiving this error. I believe i am initializing correctly. Can anyone lend a hand?
sound.h
class Sound
{
private:
static irrklang::ISoundEngine* _soundDevice;
public:
Sound();
~Sound();
//getter and setter for _soundDevice
irrklang::ISoundEngine* getSoundDevice() { return _soundDevice; }
// void setSoundDevice(irrklang::ISoundEngine* value) { _soundDevice = value; }
static bool initialise();
static void shutdown();
sound.cpp
namespace GameEngine
{
Sound::Sound() { }
Sound::~Sound() { }
bool Sound::initialise()
{
//initialise the sound engine
_soundDevice = irrklang::createIrrKlangDevice();
if (!_soundDevice)
{
std::cerr << "Error creating sound device" << std::endl;
return false;
}
}
void Sound::shutdown()
{
_soundDevice->drop();
}
and where i use the sound device
GameEngine::Sound* sound = new GameEngine::Sound();
namespace GameEngine
{
bool Game::initialise()
{
///
/// non-related code removed
///
//initialise the sound engine
if (!Sound::initialise())
return false;
Any help would be greatly appreciated