Hello you guys. I'm very excited since I'm so close to finishing my project. However before I'm totally done I am kind of stuck on this error message when compiling. It says "cannot find -lobjc." Have anyone seen this before? What does it mean? I've added my entire code if you want to look it through see below.

This is in the Engine source file. "Engine.cpp"

//This here contains the definition of the class member functions
#include "Engine.h"

EngineBlock::EngineBlock(HINSTANCE hinstance, LPSTR szwinclassname, LPSTR szwintitle, WORD wicon, WORD wiconsm, int iwidth, int iheight)
  //When called the constructor will initiate these member values
  cm_pEngine = &cm_cEngine;
  cm_handinst = hinstance;
  cm_winhandle = NULL;
    lstrcpy(cm_szWinClassName, szwinclassname);
    lstrcpy(cm_szWinTitle, szwintitle);
  cm_wicon = wicon;
  cm_wiconsm = wiconsm;
  cm_iwidth = iwidth;
  cm_iheight = iheight;


bool EngineBlock::IgniteEngine(int ishow)
  AppWinClass.cbSize = sizeof(AppWinClass);
  AppWinClass.cbClsExtra = 0;
  AppWinClass.cbWndExtra = 0;
  AppWinClass.style = CS_HREDRAW | CS_VREDRAW;
  AppWinClass.lpfnWndProc = t1f_winproc;
  AppWinClass.hInstance = cm_handinst;
  AppWinClass.lpszMenuName = NULL;
  AppWinClass.lpszClassName = cm_szWinClassName;
  AppWinClass.hCursor = LoadCursor(NULL, IDC_ARROW);
  AppWinClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  AppWinClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
  AppWinClass.hbrBackground = (HBRUSH)(BLACK_BRUSH);

    return false;


    return false;

  //Show and updates window
  ShowWindow(cm_winhandle, ishow);

  return true;

LRESULT CALLBACK EngineBlock::FCUnit(HWND winhando, UINT umessage, WPARAM upperparam, LPARAM lowerparam)
    case WM_CREATE:
      //Displays the application window and enters the loop
      return 0;

    case WM_PAINT:
      HDC hdc;
      hdc = BeginPaint(winhando, &ps);

      //Paints the application window on screen. Later it will be on buffer then screened

      EndPaint(winhando, &ps);
      return 0;

    case WM_DESTROY:
      //Terminates the program
      return 0;

This is in the "Engine.h" header file.

#include <windows.h>
#include <windowsx.h>
#include <stdlib.h>

//Prototype for Window procedure
LRESULT CALLBACK t1f_winproc(HWND winhandle, UINT umessage, WPARAM upperparam, LPARAM lowerparam);

//WinMain prototype
int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE hprevi, LPSTR szcmd, int ishow);

//Main function prototypes
bool EngineOn(HINSTANCE hinstance);
void EngineGo(HWND winhando);
void EngineOff();
void EngineRefill(HDC hdc);
void EngineIterate();

//The class 'EngineBlock'
class EngineBlock
  //Members accessable only by members of the same class, derived class and friends of the class.
  static EngineBlock* cm_pEngine; //pointer to a class of EngineBlock type
  static EngineBlock cm_cEngine;//the class Imade static
  HWND cm_winhandle;
  HINSTANCE cm_handinst;
  TCHAR cm_szWinClassName[32];
  TCHAR cm_szWinTitle[32];
  WORD cm_wicon, cm_wiconsm;
  int cm_iwidth, cm_iheight;

  //Constructors, destructurctors, and leak.
  EngineBlock(HINSTANCE hinstance, LPSTR szwinclassname, LPSTR szwintitle, WORD wicon, WORD wiconsm, int iwidth = 640, int iheight = 480);
  virtual ~EngineBlock(); //Not sure whether to use virtual or not. Still don't have enough info.

  static EngineBlock* GrabEngine(){return cm_pEngine;};//returns the address of the class
  bool IgniteEngine(int ishow);//creates and registers the window
  LRESULT CALLBACK FCUnit(HWND winhando, UINT umessage, WPARAM upperparam, LPARAM lowerparam);//this function does the work of the Window procedure

  HINSTANCE LeakInstance(){return cm_handinst;}; //Returns the instance handle
  HWND LeakHwnd(){return cm_winhandle;}; //the Window handle
  LPSTR LeakTitle(){return cm_szWinTitle;};//the Title
  WORD LeakIcon(){return cm_wicon;};//the Icon
  WORD LeakIconSm(){return cm_wiconsm;};//the Small Icon
  int LeakWidth(){return cm_iwidth;};//width of the window
  int LeakHeight(){return cm_iheight;};//height of the window
  void LinkFrames(HWND winhando){cm_winhandle = winhando;};//sets the member with the window handle

This is the code for Main

#include "EngineMain.h"

int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE hprevi, LPSTR szcmd, int ishow)
  MSG umsg;//the message container

  if(EngineOn(hinstance)) //Only when true
    //Check to see initiation is successful
      return false;

      if(PeekMessage(&umsg, NULL, 0, 0, PM_REMOVE))
        //Execute quit when close is activated
        if(umsg.message == WM_QUIT)
        TranslateMessage(&umsg);//I think these don't even get
        DispatchMessage(&umsg);//to execute at all gotta find a better place for them, maybe
      }//End of Quit check
      }//Else closing brace
    }//While closing brace
    return (int)umsg.wParam;
  }//Closing brace for primary if statement

  //Terminates the program

  return true;
}//Closing brace for WinMain

//Not sure if I should give it this name it throws off my rythm
LRESULT CALLBACK t1f_winproc(HWND winhandle, UINT umessage, WPARAM upperparam, LPARAM lowerparam)
  return EngineBlock::GrabEngine()->FCUnit(winhandle, umessage, upperparam, lowerparam);

//T1 functions
bool EngineOn(HINSTANCE hinstance)
  _pEngine = new EngineBlock(hinstance, TEXT("SUCCESS"), TEXT("Success"), IDI_APPICON, IDI_APPICONSM);

  if(_pEngine = NULL)
    return false;

  return true;

void EngineGo(HWND winhando)
  //Get a random seeding

void EngineOff()
  //Free all allocated memories
  delete _pEngine;

void EngineRefill(HDC hdc)

void EngineIterate()
  HDC hdc;
  HWND hwnd = _pEngine->LeakHwnd();

  hdc = GetDC(hwnd);
/*Normally this next line was commented out because it show an error I didn't want to deal with right now cause I don't have much information on it*/
  DrawIcon(hdc, rand()%_pEngine->LeakWidth(), rand()%_pEngine->LeakHeight(), (HICON)(WORD)GetClassLong(hwnd, GCL_HICON));
  ReleaseDC(hwnd, hdc);

That should be all for now I don't want to take too much memory??? A thousand thanks.

That error means the linker can not find a library. Check your computer file system to see if it exists. It has nothing to do with the code you posted.

objc is for Objective C (sort of like C++, only different), yet your code looks like C++ proper.

Which compiler are you using. If it's a command line compiler, paste your command line (or some compile logs if you're using an IDE).

Salem you are correct that I am using C++ syntax. The IDE I am using is Bloodshed DevC++ and Visual Studios 5 but I have to agree with AncientDragon on this one. I may have forgotten to direct the complier to where to search for my libraries. Thank you guys a billion for your help. A thousand years of good fortune to you both. Good day.

. A thousand years of good fortune to you both..

OMG! I don't want to live that long :)

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.