Jump to content
  • Advertisement
Sign in to follow this  

SDL issues

This topic is 2157 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
//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 );
SDL_Delay( 2000 );

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

Theres my code if it helps

Share this post

Link to post
Share on other sites
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)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!