   About linkin errors and parameters in function
  Hi again! I'm reading some SDL tutorials from LazyFoo's site (they're AMAZING!) and I tried to write my own code to open two images and blit them. DevC++ returned this error:[Linker error] undefined reference to "IMG_Load".Id returned 1 exit status[Build Error] [Proyecto1.exe] Error 1And here is the code: #include <SDL/SDL.h>#include <SDL/SDL_image.h>#include <string>const int SCREEN_WIDTH = 640;const int SCREEN_HEIGHT = 480;const int SCREEN_BPP = 32;SDL_Surface *screen = NULL;SDL_Surface *background = NULL;SDL_Surface *message = NULL;SDL_Surface *CargarImagen(std::string filename){    SDL_Surface *imagenCargada = NULL;    SDL_Surface *imagenOptimizada = NULL;   imagenCargada = IMG_Load( filename.c_str() );   if ( imagenCargada != NULL )    {   imagenOptimizada = SDL_DisplayFormat( imagenCargada ); SDL_FreeSurface( imagenCargada );    }   return imagenOptimizada;}void AplicarSurface( int x, int y, SDL_Surface* source, SDL_Surface* destino ){    SDL_Rect offset;   offset.x = x;    offset.y = y;   SDL_BlitSurface( source, NULL, destino, &offset );}int main( int argc, char* args[] ){   if ( SDL_Init( SDL_INIT_EVERYTHING ) == -1 )    {   return 1;    }   screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );   if ( screen == NULL )    {   return 1;    }   SDL_WM_SetCaption( "Test", NULL);   background = CargarImagen( "lala.png" );    message = CargarImagen( "hello_world.bmp" );   AplicarSurface(0, 0, background, screen);    AplicarSurface(180, 140, message, screen);   if ( SDL_Flip( screen ) == -1 )    {   return 1;    }   SDL_Delay( 1000 );   SDL_FreeSurface( background );    SDL_FreeSurface( message );   SDL_Quit();   return 0;}The images are in the same directory with the source code. SDL is installed ok. I tried to compile tutorial 2 from that site and everything went fine. I don't know what's happening now :(By the way. There's one more thing I don't understand. Tutorial 5 teachs about color keying. I need help with this line of the code:SDL_SetColorKey( optimizedImage, SDL_RLEACCEL | SDL_SRCCOLORKEY, colorkey );What's the "|" for?? here is the link to the entire code.Thank u in advance for your help!   
  1) Did you link against the SDL_Image archive?2) The | means to take the bitwise or of the two values, which in this case, is equivalent to adding them together. It basically means you want the effect of both flags.   ;  1) I put -ISDL_image in proyect's options, in parameter's section. I don't know why it doesn't work :(2) How does the function know which of the two options go?? does it work like || for compare expressions?Thank u a lot :)   ;  1) I think you want -lSDL_image (Lower case L not uppercase I)2) It applies both of them.   ;  2) a bit is a 1 or a 0. a byte is 8 bits.instead of using a lot of booleans , some functions use bits to set flags.so as you see if you have a 1 byte var , it can be usedto set 8 flags , by setting any bit to a 1 (if the flag is true) or to a 0 (if it's false). the ||  operator compares corresponding bits in vars. the result of this comparison is a new var. the || operator sets the corresponding bit in the result to 1 if any of the bits it was comparing was set to 1, so bascily the ||(OR) operator states that " if any bit was set to one , the result is one".exampleflag 1 : 0000 0001 (this is a 1*2^0)flag 2: 0000 0010 ( this is a 1*2^1)flag 3: 0100 0000  ( this is a 1*2^6)flage1 || flag 2 || flag 3 = 0100 0011 ( which is (1*2^6 + 1*2^1 + 1*2^0) = 67)then the function tests every bit to see if it's set or clear (1 or 0 ) , and knows if the flag is set according to that.you can write 67 in the param to see for your self.   ;  1) I'm an idiot.. lol. Now it worked with -lSDL_image.2) Ok! I got the idea. But.. how can you set a bit in a var? For example, in an unsigned short integer var (2 bytes, doesn't it?).Sorry if my questions are too idiot. Thanks both of you for helping me![Edited by - GutyGu on June 23, 2006 8:36:55 AM]