SDL_mixer Includes and Compiling

Includes

To use SDL_mixer functions in a C/C++ source code file, you must use the SDL_mixer.h include file:

#include "SDL_mixer.h"

Compiling

To link with SDL_mixer you should use sdl-config to get the required SDL compilation options. After that, compiling with SDL_mixer is quite easy. Note: Some systems may not have the SDL_mixer library and include file in the same place as the SDL library and includes are located, in that case you will need to add more -I and -L paths to these command lines.

Simple Example for compiling an object file:

cc -c `sdl-config --cflags` mysource.c

Simple Example for compiling an object file:

cc -o myprogram mysource.o `sdl-config --libs` -lSDL_mixer

Now myprogram is ready to run.

SDL_mixer_Includes_and_Compiling (last edited 2008-04-17 08:18:51 by localhost)