XCode 4 Bug – Duplicating a Target Results in Link Error Due to Missing Paths

This should be titled, “oh XCode 4 why do you spite me so?”. What have I done to deserve being smote by XCode? I ran into an couple issues with the latest version of XCode 4 when I tried to duplicate an existing target that was linked against a bunch of 3rd party libraries. One of the annoying things I ran into is that the new target was autonamed “[projectname] copy”. You could rename the target, however internally it was still referred to as “[projectname] copy”. You could not change the project id in the target settings and you had to live with this. That’s a minor annoyance, what was worse was all my string paths referring to my library search paths got escaped so that the build would fail during the linking phase. So if you have this mystery problem, then go into you Target Build Settings > Library Search Path, then double-click on the path. Notice all your quotes have been escaped with a backslash. Delete those puppies and you’ll be good-to-go.

Here’s another good explanation:

http://www.executionunit.com/2011/03/25/xcode-4-duplicating-a-target-to-make-an-ipad-build-link-error/

Be careful out there! XCode doesn’t hate us, it just likes our attention and gets jealous when we don’t spend enough time tinkering with it…

2 Comments

  • Denis

    April 27, 2011, 9:13 am

    nice post, very useful at least for me :)

    By the way you can get rid of “[projectname] copy” as it is the scheme name that appears in the target list. Go to the Product menu and choose “Manage scheme…” where you can rename it.

    Denis

  • Emmy

    June 22, 2011, 5:10 am

    I hate xcode 4. so many problems and crushes all the time. I spend more time deal with xcode than doing my coding. :(

Comments are closed

Top