Where Xcode expects to find dylib

Hi, ALL,

This thread comes from the one here

The question now becomes - where Xcode expects to find dylib files?

Running the bundle from the Terminal the default place is /usr/local/lib. You can create a post-build script to copy them in the bundle and relink them as appropriate. But that doesn't help with Xcode.

I also want to know who is responsible to copy those dylibs to that place. Because during development people needs to update their dylibs.

Could someone please sched some light?
Its painful not to be able to debug from Xcode and do manual work in Terminal.

Thank you.
'

Replies



Depends...not just in one place, if that's what you're asking.

A script that walks likely suspect locales is required to sniff them out.

Otherwise, it is the dev's responsibility to copy from/to, at time of, but... don't take the error literally, as it could come from having dupes, etc. making the task a delete/ignore, instead.

Just for grins, try this work-around:
  1. in the Xcode -> Organizer window, after you create an archive, right-click on your new archive

  2. press "Show in Finder"

  3. right click on the archive in Finder

  4. press "Show Package Contents"

  5. delete the 'SwiftSupport' folder

...and then go again.


Good luck.
@KMT,
The reason for my question is as follows:

I have 2 Macs: older one with 10.8 where I started development. Everything works there - I can start debugging from Xcode and I can run the program from Terminal. No issues. (I had to create a post-build script to copy dylibs inside the Bundle).

But then I bought a newer Mac with 10.13. I installed Xcode 9, grab my code from GitHub, recompiled and... Xcode won't run it. It stops somewhere in the assembly code even before hitting the first C++ line.

Since the code is exactly the same, my guess is that Xcode 9 didn't do what Xcode 5 did when I created the project and the sub-projects for dylib - it didn't preserve copying the dylibs as appropriate.

And why I suspect the dylib positioning? Because in the beginning I didn't have that post-build script. So when I tried to run the program from the Terminal on the older Mac I got exactly the same behavior.

So now I need to replicate what Xcode 5 did for my dylib's subproects - check the box in order for them to be automatically copied on the build in order for Xcode to pick them up.

Does this make sense?

Thank you.

P.S.: I hope you will be able to see my reply. There is no notification.

Ah, more details, thanks - let me chew on them and get back later.

Ken
@KMT,

Any thoughts?

Thank you.