problem with simple sdl code

hi i am trying to load an image. I made a program to do so. I get errors that say use of undeclared indentifier "sdl surface, hello, and null"
the errors are on lines 6,7 10, and 13. How do i declare the identifier then? Plz help . thanks



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#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;
}
bumpe
I think that the problem is that NULL is undefined name. You should include a corresponding header that contains definition of NULL. Or use 0 instead of NULL.
Topic archived. No new replies allowed.