ZeroLink Must Die


ZeroLink, while a wickedly cool hack, causes more problems that it is worth for most programmers, especially beginners or those new to the platform. It's an embarrassment to the programmer when they give out a debug build that has been ZeroLinked: "dude, can't you give me something that works?" "D'oh! Let me rebuild", and an embarrassment for the platform as a whole. "Those MAC guys can't make working software" I've also fixed client problems that could be tracked down to ZeroLink (such as interactions with custom C++ operator new/delete, sometimes would use the customized version, and sometimes would use the library version, leading to mayhem). If ZeroLink works for you and saves you time, that's great. It hasn't saved me any time, and has caused more problems than it has solved.

Unfortunately, ZeroLink is turned on for all new Xcode projects. I've submitted a bug asking that it not be turned on by default (let those who really need fast link times turn it on when necessary), and got the usual "Duplicate" response. Guess I'm not the only one. So up until now, for every new project I make (and I make a lot of them, to test features and isolate bugs for bugreporter test cases), I go into the inspectors and make sure ZeroLink is turned off.

XCode 2.1 has this potentially cool feature where you can specify an xcconfig file to change build settings. Unfortunately you can't use it to turn off ZeroLink, which makes it broken for me. Here is the start of a thread on Xcode-users that discusses this behavior.

Both Apple guys that responded said "edit your project templates". So I guess that's what I need to do. Here's how you can do it too (and for me to find so I can re-run this whenever a new Xcode comes out that updates the project templates)

% cd '/Library/Application Support/Apple/Developer Tools/Project Templates'
% find . -name "*.pbxproj" -exec perl -pi -e "s/ZERO_LINK = YES/ZERO_LINK = NO/g" {} \; -print
You may want to make a backup of your Project Templates directory before running that find.

10:14 PM, 29 Jun 2005 by Mark Dalrymple Permalink

Add comment


borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com