On Mon, 8 Oct 2007, Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
/home/marcus/Pike/7.7/build/linux-2.6.22-12-powerpc-ppc/libOCpike.so: undefined reference to `__gnu_objc_personality_v0' /home/marcus/Pike/7.7/build/linux-2.6.22-12-powerpc-ppc/libOCpike.so: undefined reference to `objc_exception_throw'
Hmm... I don't know much about libFoundation, but perhaps their libobjc doesn't support exceptions? That's awefully odd, though.
I found this, which seems to offer a different (incompatible) way of doing exceptions.
http://www.geocities.com/SiliconValley/Monitor/7464/libFoundation/doc/libFou...
The reference to the symbols come from OCPikeInterpreter.o, presumably due to the statement "@throw exception;". It's possible that I need to specify some GCC option when compiling this file to get exceptions which work with libFoundation rather than with libobjc...
You must call +[NSProcessInfo initializeWithArguments:count:environment:] in main()
I tested removing the NSAutoreleasePool stuff to see if that was what was causing it, but it made no difference.
I'm guessing that this is a non-Darwin Foundationism, as that's not needed (or defined, for that matter) on Darwin. I don't think that really has anything to do with "my" code; it seems like you'd always need to do it.
See: http://gnustep.org/resources/documentation/Developer/Base/Reference/NSProces...
The best way forward is probably trying to figure out the correct way to support exceptions together with libFoundation so that I can get down to just one libobjc... ;-)
Yeah, I think that URL above describes it, using -fobjc-exceptions is the way to enable it on darwin, it's possible that gnu gcc works similarly, but probably depends on support in libobjc. It's probably best to get some configure support for selecting the runtime and foundation framework. Then we can add some conditionals.
Isn't objective-c grand??? :O
Bill