Re: Weird Objective-C observation
Re: Weird Objective-C observation
- Subject: Re: Weird Objective-C observation
- From: John Stiles <email@hidden>
- Date: Wed, 7 Sep 2005 11:52:41 -0700
I should have mentioned it originally, but yes, I'm doing everything
with Xcode.
On Sep 7, 2005, at 11:50 AM, Timothy J. Wood wrote:
On Sep 7, 2005, at 10:39 AM, John Stiles wrote:
I couldn't figure out a way to make a lib file and still have it
retain its Objective-C functionality. As soon as I retarget the
NDAlias code to be built as part of the main project instead of
the lib, then clean and rebuild, this problem vanishes. So I have
a workable solution, but it seems a little hokey. Why is this
happening?
This seems surprising if you are using Xcode, but maybe they
changed something (we don't use static libraries). At any rate,
this used to happen on platforms that didn't understand ObjC.
Typically .o files in a ar archive are only linked if one symbol
from the .o file is used. Since the main app often won't need any
symbols from the .o file containing the category, the .o file won't
be pulled out of the archive.
The -ObjC and -all_load flags on the Mach-O linker are there to
handle this. If you are using the Xcode toolchain, you might be
able to copy the gcc invocation out of Xcode and paste it into to
Terminal and add a '-v' flag to get it to show you the 'ld' command
it is using. If you are using CW, I have no idea other than the
linker possibly not pulling in the symbols from the category .o file.
-tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden