[SDL] Problem with SDL_Mixer
Ben Ockmore
firework at ockmore.co.uk
Wed Jun 18 09:04:19 PDT 2008
Hey all,
These few lines:
if(Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 1024) == -1)
{
printf("Warning: Couldn't set 44100 Hz 16-bit audio\n - Reason:
%s\n", SDL_GetError());
}
.Are causing my SDL app to freeze due to a segmentation fault. I realized it
was these lines due to the fact that when I comment them out, the program
runs smoothly. I don't see why they're causing me a problem, because I've
implemented SDL_Mixer successfully before and never had these problems. The
only change in this program is that they're now in an SDL_init() function,
which is called by main, rather than actually being in main.
I'm including the following SDL headers:
#include <SDL/SDL.h>
#include <SDL_mixer.h>
#include <SDL_opengl.h>
#include "TTF\\SDL_ttf.h"
.And linking to:
"../../OpenGL .lib and .h/libglu32.a"
-lmingw32
-lSDLmain
-lSDL
-lopengl32
SDL_ttf.dll
-lSDL_mixer
With the compiler option:
-Dmain=SDL_main
Many thanks for your help in advance!
- Sputty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080618/33d8b67b/attachment.htm>
More information about the SDL
mailing list