Re: Framework development and Garbage collection required option?
Re: Framework development and Garbage collection required option?
- Subject: Re: Framework development and Garbage collection required option?
- From: Brad Barclay <email@hidden>
- Date: Wed, 12 Dec 2007 13:37:20 -0800
On 12-Dec-07, at 10:22 , Bill Bumgarner wrote:
Hi Bill:
Thanks for the input. A quick response:
I just tested this against a simple Cocoa framework; build without
GC, then build with GC only. It worked fine. This indicates that
there is something in the configuration of your project triggering
this behavior.
Well, that's positive news. I can work with it being a configuration
problem on my end, and think I've found the source.
This appears to be two bugs; one in your project's configuration
and one in the absolutely baffling error message spit out by the
compiler / Xcode.
It may also be some sort of bug in the Xcode 3.0 template for a Cocoa
Framework (which I should have mentioned is what I started from,
without any changes other than to the Garbage Collection option).
Editing the target properties directly, I found that both the main
Framework target's and the Unit Testing target's Debug/Release
configurations had the "Prefix Header" (GCC_PREFIX_HEADER) property
set (the main Framework build target had it set to the Framework being
built, and the Unit Test had it set to "$(SYSTEM_LIBRARY_DIR)/
Frameworks/Cocoa.framework/Headers/Cocoa.h").
Removing these and leaving the field blank allows the build with
"Garbage Collection: Required" set to complete correctly. However, I
am concerned that there is an Xcode related issue, as leaving these
set and merely changing the Garbage Collection setting to "Supported"
allows them to build just fine.
If your application and GC'd unit tests are the only ones that will
use the framework, you can safely build with "gc supported" and
ignore all retain/release/autorelease calls. It'll leak like a
sieve if ever used in non-GC, of course.
Not an issue, fortunately. So now I'm to the point where I can get
it to build with Garbage Collection set to Required, however now the
Unit Test rig tool crashes with no explanation:
/Developer/Tools/RunUnitTests:314: error: Test rig '/Developer/Tools/
otest' exited abnormally with code 5 (it may have crashed).
I'm not quite sure if removing the "Prefix Header" for the Framework
build is a good idea or not, but at least it allows me to build with
Garbage Collection set to Required. I'm going to have to do some
further investigation against the test rig tool crashing on me -- I
think I'm almost to the point where I'm just going to create a brand-
new Xcode project and just copy the sources over (in the event I
accidentally modified a setting somewhere somehow).
Thanks again for your input. I've only worked on a small number of
ObjC/Cocoa projects, so some of these issues and their related
settings are a bit new to me.
Brad BARCLAY
=-=-=-=-=-=-=-=-=-=
From the Mac OS X Desktop of Brad BARCLAY
E-Mail: email@hidden Web: http://www.jsyncmanager.org
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden