when i try to compile this code i get
ERORR: unable to open include file sdl.h
#include "stdlib.h"
#include "SDL/SDL.h"
// *** IF USING XCODE ON MACOS X, YOU MAY NEED TO CHANGE THE FOLLOWING LINE TO: #include "SDL_mixer/SDL_mixer.h"
#include "SDL/SDL_mixer.h"
//Function prototyping action!
void musicFinished();
int musicPlaying = 0; //Is the music playing, or not?
int main(int argc, char *argv[])
{
SDL_Surface *screen; //Pointer to the main screen surface
Mix_Music *music; //Pointer to our music, in memory
int audio_rate = 22050; //Frequency of audio playback
Uint16 audio_format = AUDIO_S16SYS; //Format of the audio we're playing
int audio_channels = 2; //2 channels = stereo
int audio_buffers = 4096; //Size of the audio buffers in memory
//Initialize BOTH SDL video and SDL audio
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0)
{
printf("Unable to initialize SDL: %s\n", SDL_GetError());
return 1;
}
//Initialize SDL_mixer with our chosen audio settings
if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) != 0)
{
printf("Unable to initialize audio: %s\n", Mix_GetError());
return 1;
}
//Load our OGG file from disk
music = Mix_LoadMUS("music.ogg");
if(music == NULL)
{
printf("Unable to load OGG file: %s\n", Mix_GetError());
return 1;
}
//Set the video mode to anything, just need a window
screen = SDL_SetVideoMode(320, 240, 0, SDL_ANYFORMAT);
if (screen == NULL)
{
printf("Unable to set video mode: %s\n", SDL_GetError());
return 1;
}
if(Mix_PlayMusic(music, 0) == -1)
{
printf("Unable to play OGG file: %s\n", Mix_GetError());
return 1;
}
musicPlaying = 1;
Mix_HookMusicFinished(musicFinished);
while(musicPlaying)
{
SDL_Delay(100);
}
Mix_HaltMusic();
Mix_FreeMusic(music);
Mix_CloseAudio();
SDL_Quit();
return 0;
}
void musicFinished()
{ musicPlaying = 0;
}
Where can i get it.