0
Error   1   error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::SoundStream::play(void)" (__imp_?play@SoundStream@sf@@QAEXXZ)  C:\Users\Nikola\documents\visual studio 2013\Projects\LoopsTest1\LoopsTest1\main.obj    LoopsTest1
Error   2   error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Music::openFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?openFromFile@Music@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  C:\Users\Nikola\documents\visual studio 2013\Projects\LoopsTest1\LoopsTest1\main.obj    LoopsTest1

Error   3   error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Music::~Music(void)" (__imp_??1Music@sf@@UAE@XZ)    C:\Users\Nikola\documents\visual studio 2013\Projects\LoopsTest1\LoopsTest1\main.obj    LoopsTest1
Error   4   error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Music::Music(void)" (__imp_??0Music@sf@@QAE@XZ) C:\Users\Nikola\documents\visual studio 2013\Projects\LoopsTest1\LoopsTest1\main.obj    LoopsTest1
Error   5   error LNK1120: 4 unresolved externals   C:\Users\Nikola\documents\visual studio 2013\Projects\LoopsTest1\Release\LoopsTest1.exe LoopsTest1

I'm using SFML 2.3 to play an ogg file. I'm a novice to C++. Not sure what's causing it. This is the code I'm using to play the ogg sound.Thanks in advanced. sf::Music music; music.openFromFile("Forest_v3.ogg"); return -1; music.play();

Edit : I've attempted pasting all the DLLs from SFML/bin into my source files folder but no changes. I've also referenced the sfml-audio-d.lib file but no changes. The errors remain.

1 Answer 1

2

I do not think you setup your IDE properly. If using visual studio, you need to do the following:

  1. Go to your SFML folder >> bin. Then, copy & paste all those DLL's into the same folder as your source files.
  2. Then go to Project>>Properties>>Linker>>Input>>Additional Dependencies: and make sure that you have "sfml-audio-d.lib" in there. (While using debug)

Edit: Actually, the missing DLL's in the same directory would cause an error dialog box to appear, but not the exception you are having. Are you running in release? Go to Build>>Configuration Manager, and it should say "Debug" under "Active Solution Configuration", as well as under "Configuration".

Update me on your status and I will do the same for my answer.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah - I was running it in release. Setting it to debug hasn't changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.