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

Author Topic: The program crashes when I use "sf::Music"  (Read 5973 times)

0 Members and 1 Guest are viewing this topic.

DyFxvt

  • Newbie
  • *
  • Posts: 5
    • View Profile
The program crashes when I use "sf::Music"
« on: October 15, 2020, 01:20:20 am »
When I use sf:Music my program crashes and a popup says "The application was unable to start correctly (0xc000007b). Click OK to close the application.". I looked it up for a few hours and saw it was because I didn't have a file called "libsndfile-1.dll". However I never got that file. When I try to re-install SFML I never get the file.
I install SFML by compiling with CMake.
What do I do?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10800
    • View Profile
    • development blog
    • Email
Re: The program crashes when I use "sf::Music"
« Reply #1 on: October 15, 2020, 10:34:41 am »
If you build the examples that SFML comes with, do they work?

0xc000007b is often an indication of mixing x64 and x86, so make sure you're using the same compiler target for both building SFML and using SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

DyFxvt

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: The program crashes when I use "sf::Music"
« Reply #2 on: October 15, 2020, 01:01:05 pm »
I haven't tried all of the example programs, but yes, I did get the same error for the ones I tried.
I checked the build info on the gcc compiler, and it says I have 32bit, and I'm definitely sure I have 32bit SFML... Should I try re-installing them anyways?

Edit: I tried both Code::Blocks 32bit and 64bit, it still doesn't work...
« Last Edit: October 15, 2020, 11:19:21 pm by DyFxvt »

Kvaz1r

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Email
Re: The program crashes when I use "sf::Music"
« Reply #3 on: October 24, 2020, 10:26:59 am »
I also have the same issue with VS2019.

Kvaz1r

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Email
Re: The program crashes when I use "sf::Music"
« Reply #4 on: October 24, 2020, 11:49:29 am »
Ok, found a workaround - I rebuilded "fresh" release of OpenAL(openal-soft-1.20.1) and replace .dll that came with SFML with new one. Everything works now.
I absolutely have any idea why it works though.

But maybe it's time to upgrade anyway?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10800
    • View Profile
    • development blog
    • Email
Re: The program crashes when I use "sf::Music"
« Reply #5 on: October 24, 2020, 01:48:29 pm »
Sounds like you might have simply used the wrong version of the OpenAL DLL (x86 vs x64 architecture) and by rebuilding OpenAL yourself, you made sure to use the same compiler and thus matching architecture.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/