Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Linker Error when using Sound functions  (Read 1977 times)

0 Members and 1 Guest are viewing this topic.

tut

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Linker Error when using Sound functions
« on: March 09, 2018, 04:07:43 pm »
Hello all,

I have started to use SFML recently. So I downloaded the 2.4.2 Win64 version of the library and started to play around the examples.
The only problem I have encountered so far is a linker error when I call play/pause/stop on a sf::Sound object. For example for play I get:

main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void __cdecl sf::Sound::play(void)" (__imp_?stop@Sound@sf@@UEAAXXZ) referenced in function main

Note that I am linking against sfml-audio.lib and can use other objects of the audio lib like AudioBuffers or even other functions of the sf::Sound like setBuffer which is wierd to me.

Does anyone have a clue on whats happening?

Thanks in advance.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: Linker Error when using Sound functions
« Reply #1 on: March 10, 2018, 10:05:03 pm »
Maybe you're using older or newer header files and thr function isn't present in the DLL or the mangled name got changed. Make sure the used headers match the library.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/