Hello, I am working on trying to get Music working in my project, and have run into a strange issue where regardless of what I do with an sf:Music object, even if I simply only have one declared at all and regardless of where in my program it is declared, the program crashes or breaks when main() returns. I am using the SFML 2.0 RC on Windows XP Service Pack 3, if that makes any difference.
Other sounds play and work perfectly fine and the music plays fine if I have code in to load and play it, however regardless of whether that code is in or not it still crashes on exit.
Edit: I have tested the program on a computer running Windows 7 with the same Dlls and SFML version, and the error is not reproduced on it, so this seems to be an issue that is exclusive to Windows XP Service Pack 3, or at least for me.
Here is some code to show the issue:
#include <SFML/Audio.hpp>
int main()
{
sf::Music test;
//It crashes with or without the following sf::Music related lines
test.openFromFile("test.ogg");
test.play();
test.stop();
//It also crashes with the same error with or without a main game loop
//and window, so I removed the main game loop and render window code
//from this snippet.
return 0;
}
This is what comes up in the output box in VC++ when it crashes on exit:
First-chance exception at 0x004653cc in SFML Basic Build.exe: 0xC0000005: Access violation reading location 0x00a3c820.
Unhandled exception at 0x004653cc in SFML Basic Build.exe: 0xC0000005: Access violation reading location 0x00a3c820.
Any help on this would be greatly appreciated,
Thanks!
Here is a screenshot of the program crashing on exit when built as a release build and run from the exe:
~~Tofugames