Hello guys.
The
sf::SoundStream appears to show a linking error with
sf::ThreadThis is the code I am trying to compile:
audioStream.hpp:#pragma once
#include <string>
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
class audioStream : public sf::SoundStream {
public:
void setFile(std::string file);
bool startLoading();
bool isLoaded();
audioStream();
private:
void load();
bool onGetData(Chunk& chunk);
void onSeek(unsigned int timeOffset);
sf::SoundBuffer buffer;
std::string m_file;
bool m_loaded;
sf::Thread *m_loadThread;
sf::Mutex m_loadMutex;
int streamPosition;
int fileSize;
};
audioStream.cpp:#include "audioStream.hpp"
bool audioStream::onGetData(Chunk& chunk) {
return 0;
}
void audioStream::onSeek(unsigned int timeOffset) {}
audioStream::audioStream() {}
Build Messages:C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStreamD2Ev':|
D:\downloads\SFML-2.1\src\SFML\Audio\SoundStream.cpp|56|undefined reference to `sf::Thread::~Thread()'|
D:\downloads\SFML-2.1\src\SFML\Audio\SoundStream.cpp|56|undefined reference to `sf::Thread::~Thread()'|
C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStream4playEv':|
D:\downloads\SFML-2.1\src\SFML\Audio\SoundStream.cpp|105|undefined reference to `sf::Thread::launch()'|
C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStream4stopEv':|
D:\downloads\SFML-2.1\src\SFML\Audio\SoundStream.cpp|121|undefined reference to `sf::Thread::wait()'|
C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStream16setPlayingOffsetENS_4TimeE':|
D:\downloads\SFML-2.1\src\SFML\Audio\SoundStream.cpp|164|undefined reference to `sf::Thread::launch()'|
||=== Build finished: 5 errors, 0 warnings (0 minutes, 0 seconds) ===|
Thanks!