So I have in my program the line:
file_cabinet.h:
sound_map["ground_collide"].LoadFromFile("Sounds\\Land.wav");
sf::SoundBuffer &get_sound_buffer(std::string filename);
sound_map is a map<std::string, sf::SoundBuffer>.
later in another file:
sf::Sound sound;
sound.SetBuffer(file_cabinet.get_sound_buffer("Sounds\\Land.wav"));
sound.Play();
If I leave everything in, the application throws a heap corruption.
If I uncomment everything but the LoadFromFile line, it still throws it. If I uncomment only that line, it doesn't throw it, which says to me that something in LoadFromFile is going wrong.
The call trace:
ntdll.dll!76e64513()
msvcrt.dll!763198cd()
libsndfile-1.dll!6f145dc1()
> Mindjob.exe!wmainCRTStartup() Line 371 C
kernel32.dll!76231194()
ntdll.dll!76dfb429()
ntdll.dll!76dfb3fc()
I triple-checked to make sure that there aren't any conflicting versions of libsndfile-1.dll or openal32.dll.
edit: To answer what I'm sure are common questions ...
- I made sure early on in the project that I haven't mixed up debug and release versions of the SFML libraries (I had to recompile them since the FAQ said that there were no current versions available for VC 2010).
- I'm using the libsndfile-1.dll and openal32.dll that are linked in the VC 2008 version of the C++ 1.6 package.