When i try to compile my source code, it comes up with two errors:
the first one is:
cannot find -lobjc
the second one is:
Id returned 1 exit status

Recommended Answers

All 4 Replies

Well objc is for objective-c (another language variant), so I've no idea why you would even be trying to link with it.

Well... i am not trying to link with it... i'm trying NOT to link with it... but i'm a n00b... so i don't knwo how :S

Here's my source code:

#include <SDL.h>

int main(int argc, char* argv[])
{
 //initialize SDL and the video system.
 if (SDL_Init( SDL_INIT_VIDEO)<0)
 return -1;
 
 //signal SDL to change the text of the main window to SDL "Hello World".
 SDL_WM_SetCaption("Hello world","Hello World");
 
 //Create an SDL_Surface object, which represents, the game window.
 SDL_Surface* screen=SDL_SetVideoMode(640,480,0,0);
 
 //Load the SDL logo bitmap to a temporary surface
 SDL_Surface* temp=SDL_LoadBMP("data\\structures\\sdl_logo.bmp");
 
 //Create the working SDL surface which matches the display format of the temporary surface.
 SDL_Surface* bg= SDL_DisplayFormat(temp);
 
 //Free the memory allocated to the temporary SDL_Surface.
 SDL_FreeSurface(temp);
 
 SDL_Event event;
 bool quit=false;
 
 //this is the main message loop if the game.
 while(!quit)
 {
   //Check message qeue for an event.
   if (SDL_PollEvent(&event))
   {
     //If an event was found.
     switch (event.type)
     {
       //check to see if the window was closed via the "x"
       case SDL_QUIT:
       //Set the quit flag to true
       quit=true;
       break;
       
      //Check the keyboard to see if the ESC key was pressed.
      case SDL_KEYDOWN:
       switch (event.key.keysym.sym)
       {
         case SDLK_ESCAPE:
           //set our quit flag to true
           quit=true;
          break;
       }
      break; 
     }
   } 
   //Draw the background sprite:
   SDL_BlitSurface(bg, NULL, screen, NULL);   
   
   //Update the current window.
   SDL_UpdateRect(screen,0,0,0,0);      
 }

//Free the allocated memery for the background surface.
SDL_FreeSurface(bg);

//Quit SDL and allow it to clean up everything.
SDL_Quit();

//return control to windows with no errors.
return 0;
}

I am using dev-c++, so if any1 else is using that compiler, i would realy like help, changing this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.