Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SDL issues


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Braeden   Members   -  Reputation: 110

Like
0Likes
Like

Posted 28 June 2012 - 07:35 PM

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

Sponsor:

#2 Sik_the_hedgehog   Crossbones+   -  Reputation: 1815

Like
0Likes
Like

Posted 29 June 2012 - 02:01 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS