I am trying to load a music file. Loading and playing and using it work fine, but when I have an sf::Music object in my program, it gives me a return status of -2147418113.
Here's my code:
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::Music background_music;
background_music.openFromFile("Five Armies.ogg");
while (window.isOpen())
{
//Handle events
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
//Logic
//Render
}
return 0;
}
I am using MinGW 4.7.1 on Windows 7 with Code::Blocks as my IDE.
I have narrowed it down to the music because if I comment out the music and loading it will work without leaking. And it gives me the same return value whether I play it or not.