Advertisement

SDL issues

Started by June 29, 2012 01:35 AM
0 comments, last by Sik_the_hedgehog 12 years, 5 months ago
When I try to compile an sdl program I get this error "1>LINK : fatal error LNK1104: cannot open file 'SDL.lib'". I've got it configured right, I've tried including it in the rescource files, using #pragma comment(lib, "SDL"), but I still get the error.
#include "SDL.h"
int main( int argc, char* args[] )
{
//The images
SDL_Surface* preview2 = 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
preview2 = SDL_LoadBMP( "preview2" );

//Apply image to screen
SDL_BlitSurface( preview2, NULL, screen, NULL );
//Update Screen
SDL_Flip( screen );
//Pause
SDL_Delay( 2000 );

//Free the loaded image
SDL_FreeSurface( preview2 );
//Quit SDL
SDL_Quit();
return 0;
}

Theres my code if it helps
That's a linker error, not a compiler error, so don't bother much with the code.

It seems like the SDL lib file wasn't copied to the directory where the toolchain keeps the libraries. Are you sure SDL was installed properly? (go to the directory and try searching for the file there)
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

This topic is closed to new replies.

Advertisement