• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Initialize Cocoa/ObjC from a dynamically-loaded bundle?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Initialize Cocoa/ObjC from a dynamically-loaded bundle?


  • Subject: Initialize Cocoa/ObjC from a dynamically-loaded bundle?
  • From: Keith Bauer <email@hidden>
  • Date: Thu, 22 Jan 2004 19:49:09 +1300

Let's suppose I have a third-party executable I have no control over (ruby, FWIW) with the ability to load plug-ins, in this case files created with ld's -dynamic and -bundle options.

Let's further suppose that said executable does not link to any Objective C frameworks, and does not call _objcInit at startup. This causes any bundles that link to Objective C frameworks to "crash" the executable with an error something like this:

objc: failed objc_getClass(NSObject) for GLUTApplication->isa->isa
objc: please link appropriate classes in your program
Trace/BPT trap

Is there anything I can do, without modifying the base executable, to get this to work?

I tried calling _objcInit() from the plug-in before it calls any Objective C code, but it's too late by then -- the error is at dynamic load time.

I tried making a second plug-in that doesn't link to any Objective C frameworks, calls _objcInit() when it's loaded, and gets loaded before the first plug-in, but that doesn't prevent the error.

Any further suggestions appreciated!

Thanks,
Keith
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Initialize Cocoa/ObjC from a dynamically-loaded bundle?
      • From: "Mark's Studio" <email@hidden>
    • Re: Initialize Cocoa/ObjC from a dynamically-loaded bundle?
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Reworked Worm example [Re: Small animation]
  • Next by Date: Re: Initialize Cocoa/ObjC from a dynamically-loaded bundle?
  • Previous by thread: Adding Items to Finder's SideBar
  • Next by thread: Re: Initialize Cocoa/ObjC from a dynamically-loaded bundle?
  • Index(es):
    • Date
    • Thread