Pregunta

I was going through this tutorial on audio using SDL_mixer and everything went just fine.

After that I decided to experiment, play, and learn through exploration, so I made a program that was very similar, had two sound channels, and let me play some video game music, and push buttons to play game sound effects.

I then started having fun and button-mashing just to be silly and test the program. I started button mashing multiple buttons really quickly and then after doing that for probably 5 or so seconds the program closed unexpectedly.

Since that date 2 or so months ago, I have been unable to run -anything- on my computer that uses SDL_mixer. I've tried creating new projects with SDL_mixer, I've re-downloaded all of SDL and SDL_mixer, and even asked this question on the sdl forums.

I'm at the point where I'm going to reformat my entire computer to get it working again, which is -NOT- ok. An extension library should never force someone to reformat, especially when this is a problem that could potentially be passed onto end users who download and use the program later.

I'm using Windows 7 64-bit; Microsoft Visual Studio 2012 Professional; C++; and SDL 1.x

Also, if anyone knows what is wrong, how can I fix this, prevent it from happening again, and safely use sound so that I wouldn't cause problems on a user's computer?

The line I used to initialize the mixer is below:

//Initialize SDL_mixer 
if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 ) == -1 ) 
{ 
    return false; 
}

The lines spat out by the debugger after I launch the program and it immediately closes:

'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\SDL_Tutorial11.exe'. Symbols loaded. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\SDL.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\SDL_image.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\SDL_ttf.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\libfreetype-6.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\zlib1.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\SDL_mixer.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110.dll'. Symbols loaded. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110.dll'. Symbols loaded. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ddraw.dll' 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\dwmapi.dll' 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\setupapi.dll' 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\devobj.dll' 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\oleaut32.dll' 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll' 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\cfgmgr32.dll' 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\dciman32.dll' 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KBDUS.DLL'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\KBDUS.DLL' 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KBDUS.DLL'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\KBDUS.DLL' 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dsound.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dinput.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\hid.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll' 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll' 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\MMDevAPI.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\propsys.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\AudioSes.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\libmikmod-2.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wdmaud.drv'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ksuser.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avrt.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msacm32.drv'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msacm32.dll'. Cannot find or open the PDB file. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Windows\SysWOW64\midimap.dll'. Cannot find or open the PDB file. 
The thread 0x5b8 has exited with code 0 (0x0). 
The thread 0x1d2c has exited with code 0 (0x0). 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\libpng15-15.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\libvorbisfile-3.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\libvorbis-0.dll'. Module was built without symbols. 
'SDL_Tutorial11.exe' (Win32): Loaded 'C:\Users\Rayne\Documents\Visual Studio 11\Projects\SDL_Tutorial11\Debug\libogg-0.dll'. Module was built without symbols. 
The thread 0x1a1c has exited with code 0 (0x0). 
The thread 0x1fbc has exited with code 0 (0x0). 
The thread 0x3f8 has exited with code 0 (0x0). 
The thread 0x584 has exited with code 0 (0x0). 
The thread 0xa98 has exited with code 0 (0x0). 
The thread 0x182c has exited with code 1 (0x1). 
The thread 0x1d1c has exited with code 1 (0x1). 
The thread 0x1278 has exited with code 1 (0x1). 
The thread 0x1d28 has exited with code 1 (0x1). 
The thread 0x1ca0 has exited with code 1 (0x1). 
The thread 0x1844 has exited with code 1 (0x1). 
The thread 0x1340 has exited with code 1 (0x1). 
The thread 0x6e8 has exited with code 1 (0x1). 
The thread 0x2008 has exited with code 1 (0x1). 
The program '[4852] SDL_Tutorial11.exe' has exited with code 1 (0x1).

P.S. Is there an easier way to denote large sections of code without having to manually copy-past 4 spaces in front of every line? That took a while ._.;

¿Fue útil?

Solución

Thanks to genpfault's advice I was able to discover a way to fix this.

It turns out that the solution was that when the program was crashing from over-loaded sound channels, that because the sounds had to be activated by key-presses, the queued up key presses were getting appended into the program's source code because Visual Studio automatically grabbed 'window focus' after the crash and 'caught' the excess characters.

The characters just happened to be appended to a string-literal of one of the first error-checking lines for the SDL_mixer functions in the very beginning of the program, so it wasn't throwing syntax errors for the compiler; the error check line was just saying "nope, the loaded file doesn't match this string exactly, so therefore close the program", which caused the program to be exiting before my break-points could register and allow me to debug.

It's an absolute relief to finally have this resolved.

Thank you genpffault and stack-overflow!~

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top