• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode does not rebuild app when source file updated in dependent static library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode does not rebuild app when source file updated in dependent static library


  • Subject: Re: Xcode does not rebuild app when source file updated in dependent static library
  • From: Michael Rawdon <email@hidden>
  • Date: Fri, 19 Oct 2012 13:40:28 -0700

On Oct 19, 2012, at 9:13 AM, Jens Alfke <email@hidden> wrote:
On Oct 19, 2012, at 8:54 AM, Russell Finn <email@hidden> wrote:
Now, if I modify the text of the message in the library source file,
then click the "build and run" button, Xcode correctly rebuilds the
library, but *fails* to relink the application, so when the
application runs, the unmodified message text is displayed.

I have projects with these kinds of dependencies, and have not seen this problem.
It sounds like Xcode doesn’t realize that the static library it’s linking into the app is the product of the library target.

It's heartening (if a bit baffling to me) that not everyone using static libraries is hitting this, but yes, this is a known bug in Xcode.

The bug isn't specifically due to static libraries (you can probably contrive a situation where it would happen for dynamic libraries), but it is more serious for more static libraries since of course it's critical that static libraries get relinked because that's how your changes make it into your app.  For dynamic libraries (which aren't available for iOS developers, but are for OS X developers), a large set of possible changes (though obviously not all of them) don't need to be detected at the time the app is relinked because they won't actually result in a changed app binary; instead the changes get picked up dynamically at run time when the dylib is loaded.

The best workaround would be to add a shell script build phase to your app target to check whether the static library's modification date is newer than that for the app's binary, and if so to remove the app's binary to force it to be relinked.

-- 
Michael Rawdon

email@hidden
Xcode Developer

Apple Inc., Cupertino CA




 _______________________________________________
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

  • Follow-Ups:
    • Re: Xcode does not rebuild app when source file updated in dependent static library
      • From: Stephan Diederich <email@hidden>
References: 
 >Xcode does not rebuild app when source file updated in dependent static library (From: Russell Finn <email@hidden>)
 >Re: Xcode does not rebuild app when source file updated in dependent static library (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Word selection boundaries
  • Next by Date: Re: Xcode 3.2.6 on 10.8?
  • Previous by thread: Re: Xcode does not rebuild app when source file updated in dependent static library
  • Next by thread: Re: Xcode does not rebuild app when source file updated in dependent static library
  • Index(es):
    • Date
    • Thread