Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL issues

Started by Braeden Jun 29, 2012 at 1:35 AM 0 replies 2.1k views
Original Post
Braeden
Braeden
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
Sik_the_hedgehog
Sik_the_hedgehog
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.