SFML community forums
Help => Audio => Topic started by: Xwilarg on November 21, 2019, 02:29:38 am
-
Hi,
I'm trying to use the SFML 2.5.1 on Windows and everything was working until I tried to use sfml audio.
When I'm trying to use sf::Music and I launch my program I have a segfault.
I already added openal32.dll next to my executable (I compiled the SFML on my computer to have it so it should be the right version).
I tried to launch my program on Visual Studio (2019) to have more information about it but I just got this:
Exception thrown at 0x00007FFD4023B40D (ntdll.dll) in RythmHero.exe: 0xC0000005: Access violation writing location 0x0000000000000008. occurred
Would someone please know how I could fix that?
Thanks in advance,
-
Sounds like something isn't initialized. Can you provide a minimal example that reproduces the issue?
-
Hi,
Sorry for the late reply, I created this small project to show the issue: https://github.com/Xwilarg/sfml-audio-bug
Just launch build.sh to build, then launch test.exe and it should crash.
-
You're using a static (and thus globally) initialized sf::Music, which is not allowed by SFML, as the initialization as well as the destruction order of global objects are undefined an since SFML too uses some globals to hide certain magic.
-
I'll change that then, thanks for your help