lesson01.cpp.text+0x27): undefined reference to `SDL_Init'
lesson01.cpp.text+0x4b): undefined reference to `SDL_SetVideoMode'
lesson01.cpp.text+0x62): undefined reference to `SDL_RWFromFile'
lesson01.cpp.text+0x72): undefined reference to `SDL_LoadBMP_RW'
lesson01.cpp.text+0x97): undefined reference to `SDL_UpperBlit'
lesson01.cpp.text+0xa2): undefined reference to `SDL_Flip'
lesson01.cpp.text+0xae): undefined reference to `SDL_Delay'
lesson01.cpp.text+0xb9): undefined reference to `SDL_FreeSurface'
lesson01.cpp.text+0xbe): undefined reference to `SDL_Quit'
collect2: ld returned 1 exit status
I got this code from a website causeI wanted to experiment with Sdl programing with c++ but even on the tutorial codes and my own I get this kind of error. i was just wondering if it the errors in the code or if its because of some file i dont have. any ways here the code.
{Basically what is the compiler telling me whats wronge with the commands flip, delay quit}
/*This source code copyrighted by Lazy Foo' Productions (2004-2009) and may not
be redestributed without written permission.*/
Code:
//Include SDL functions and datatypes
#include "SDL/SDL.h"
int main( int argc, char* args[] )
{
// The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
// Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
// Set up screen
screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
//Load image
hello = SDL_LoadBMP( "hello.bmp" );
//Apply image to screen
SDL_BlitSurface( hello, NULL, screen, NULL );
//Update Screen
SDL_Flip( screen );
//Pause
SDL_Delay( 2000 );
//Free the loaded image
SDL_FreeSurface( hello );
//Quit SDL
SDL_Quit();
return 0;
}