   Problem with SDL_mixer and SDL_ttf
  Hey everyone!I'm trying to create a simple C++ game using SDL, I've gotten quite the hang of the basics of SDL now. But today I tried using SDL_mixer and SDL_ttf to make a font and play music, but neither of them work. I'm not getting any errors, yet it still doesn't play a song or display a font.Here is the code:#include "SDL.h"#include "SDL_image.h"#include "SDL_ttf.h"#include <SDL_mixer.h>#include <time.h>#include <windows.h>#include <string>const int SCREEN_WIDTH = 640;const int SCREEN_HEIGHT = 480;const int SCREEN_BPP = 32;long int start;//FontTTF_Font *font = NULL;SDL_Color textColor = { 0, 0, 0 };//musicMix_Music *music = NULL;//screenSDL_Surface *screen = NULL;SDL_Surface *player = NULL;SDL_Surface *background = NULL;SDL_Surface *house = NULL;SDL_Surface *message = NULL;SDL_Event event;class character{    private:    int xVel;    int yVel;    public:    SDL_Rect kyleTheHero;    character();    void input();    void calc();    void show();};bool init(){    if(SDL_Init(SDL_INIT_EVERYTHING) == -1)    {   return false;    }    screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE);    if(screen == NULL)    {   return false;    }    //Initialize SDL_ttf    if( TTF_Init() == -1 )    {   return false;    }    //Initialize SDL_mixer    if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 ) == -1 )    {   return false;    }    SDL_WM_SetCaption( "Practice", NULL );    return true;}character::character(){    xVel = 0;    yVel = 0;    kyleTheHero.x = 0;    kyleTheHero.y = 0;    kyleTheHero.w = 32;    kyleTheHero.h = 32;}SDL_Surface *load_image( std::string filename ){    //The image that's loaded    SDL_Surface* loadedImage = NULL;    //The optimized surface that will be used    SDL_Surface* optimizedImage = NULL;    //Load the image    loadedImage = IMG_Load( filename.c_str() );    //If the image loaded    if ( loadedImage != NULL )    {   //Create an optimized surface   optimizedImage = SDL_DisplayFormat( loadedImage );   //Free the old surface   SDL_FreeSurface( loadedImage );   //If the surface was optimized   if ( optimizedImage != NULL )   {  //Color key surface  SDL_SetColorKey( optimizedImage, SDL_SRCCOLORKEY, SDL_MapRGB( optimizedImage->format, 100, 100, 100 ) );   }    }    //Return the optimized surface    return optimizedImage;}void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination){    SDL_Rect offset;    offset.x = x;    offset.y = y;    SDL_BlitSurface(source, NULL, destination, &offset);}void character::input(){    if(event.type == SDL_KEYDOWN)    {   switch(event.key.keysym.sym)   {  case SDLK_UP: yVel -= kyleTheHero.h / 2; break;  case SDLK_DOWN: yVel += kyleTheHero.h / 2; break;  case SDLK_LEFT: xVel -= kyleTheHero.w / 2; break;  case SDLK_RIGHT: xVel += kyleTheHero.w / 2; break;   }    }    else if(event.type == SDL_KEYUP)    {   switch(event.key.keysym.sym)   {  case SDLK_UP: yVel += kyleTheHero.h / 2; break;  case SDLK_DOWN: yVel -= kyleTheHero.h / 2; break;  case SDLK_LEFT: xVel += kyleTheHero.w / 2; break;  case SDLK_RIGHT: xVel -= kyleTheHero.w / 2; break;   }    }}void character::calc(){    kyleTheHero.y += yVel;    if((kyleTheHero.y < 0) || ((kyleTheHero.y + kyleTheHero.w) >= SCREEN_HEIGHT - 20) )    {   kyleTheHero.y -= yVel;    }    kyleTheHero.x += xVel;    if((kyleTheHero.x < 0) || ((kyleTheHero.x + kyleTheHero.w) >= SCREEN_WIDTH - 10))    {   kyleTheHero.x -= xVel;    }}void character::show(){    apply_surface( 0, 0, background, screen );    apply_surface( 40, 70, house, screen );    apply_surface( kyleTheHero.x, kyleTheHero.y, player, screen );    //Show the message on the screen    apply_surface( ( SCREEN_WIDTH - message->w ) / 2, 100, message, screen );}bool load_files(){    background = load_image("background.bmp");    player = load_image("face.bmp");    house = load_image("house.bmp");    font = TTF_OpenFont( "lazy.ttf", 30 );    if( background == NULL )    {   return false;    }    if( font == NULL )    {   return false;    }    music = Mix_LoadMUS( "beat.wav" );    //If there was a problem loading the music    if( music == NULL )    {   return false;    }    return true;}int main(int argc, char* args[]){    character meme;    if(init() == false)    {   return 1;    }    if(load_files() == false)    {   return 1;    }    bool quit = false;    message = TTF_RenderText_Solid( font, "Non-Working Font", textColor );    //If there was an error in rendering the text    if( message == NULL )    {   return 1;    }    //Free the message    SDL_FreeSurface( message );    while(quit == false)    {  //this is the timerif ((GetTickCount() - 30) >= start){start = GetTickCount();   while(SDL_PollEvent( &event))   {  if(event.type == SDL_QUIT)  { quit = true;  }  meme.input();   }   meme.calc();   SDL_FillRect(screen, &screen -> clip_rect, SDL_MapRGB(screen -> format, 0xFF, 0xFF, 0xFF));   meme.show();   if(SDL_Flip(screen) == -1)   {  return 1;   }}    }    SDL_FreeSurface(player);    SDL_Quit();    return 0;}And also another question. Every time I compile the program, I get warnings for every key press that I am not using saying that it is not handled in the switch but I don't want to use anything other than the arrow keys for now, so why is it giving me warnings everytime and how can I stop it?Thanks,Kyle =)   
  I imagine someone will help out either way, but you might have a little more luck if you were to post a minimal example demonstrating just one of the problems you mentioned (i.e. the SDL_mixer problem, or the SDL_ttf problem). For example, write a program that loads and plays back a music file, and nothing more. If it still doesn't work, post the code; otherwise, start adding things back in until it stops working (quite often you'll end up finding the problem yourself this way).As for the 'switch statement' warning, I'm not sure, but try adding an empty default block at the end of each switch statement.   ;  Well I added the function: SDL_GetError because I read through the forums someone recommended using this to find a problem.Well I got a .txt file from it, I got an error that says:"Fatal signal: Segmentation Fault (SDL Parachute Deployed)"What could this mean?Oh and thank you for the advice =)   ; Well, I might be able to help with the audio, but I don't know anything about drawing the fonts, I only use OpenGL with SDLanyhow.. in your init(), add this line (not sure if necessary for music or playing sounds, but it's in my code)Mix_AllocateChannels(1); that should allocate a channel to do stuff in then you have to actually tell it to play the music after it loads! so after your loadfiles() if statement in main() put the line:Mix_PlayMusic(music, -1); the -1 tells it to use whatever channel is available.. and now that I look at your code, you set  message = TTF_RenderText_Solid( font, "Non-Working Font", textColor );then SDL_FreeSurface it, and not only that but I don't see you using message in your code anywhere either.. there should be somewhere where you use it for drawing.. and you shouldn't SDL_FreeSurface the message variable until you get to the other side of your main loop, because you're going to be using it in your main loop.;  You sir, are a genius!You helped me with the ttf and you didn't even know how!Anyway, I got the mixer AND font to work.THANK YOU so much!I've been trying to make it work for a long time today.; no prob, glad I could help :)   