Initialize Cocoa/ObjC from a dynamically-loaded bundle?
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.