Re: Xcode, Dyld, External Dynamic Libraries and Setting {DY}LD_LIBRARY_PATH for Running Targets
Re: Xcode, Dyld, External Dynamic Libraries and Setting {DY}LD_LIBRARY_PATH for Running Targets
- Subject: Re: Xcode, Dyld, External Dynamic Libraries and Setting {DY}LD_LIBRARY_PATH for Running Targets
- From: Grant Erickson <email@hidden>
- Date: Fri, 24 Jul 2009 23:17:27 -0700
- Organization: Nuovation System Designs, LLC
- Thread-topic: Xcode, Dyld, External Dynamic Libraries and Setting {DY}LD_LIBRARY_PATH for Running Targets
On 7/24/09 10:20 PM, Ken Thomases wrote:
> On Jul 24, 2009, at 4:54 PM, Grant Erickson wrote:
>> I've added libboost_system.dylib and libboost_filesystem.dylib to my
>> project
>> as "Relative to Build Products" and added them as link libraries to my
>> target. This all works well and fine.
>>
>> However, when I go to run the target in the debugger, I get:
>>
>> [Session started at 2009-07-24 14:37:54 -0700.]
>> dyld: Library not loaded: libboost_filesystem.dylib
>> Referenced from:
>> ${HOME}/Source/results/Debug/MyApp.app/Contents/MacOS/MyApp
>> Reason: image not found
>>
>> [...]
>>
>> Long-term, my intent is to set rpath when building Boost such that
>> otool -D
>> reports:
>>
>> /Library/Application Support/Nuovations/lib/
>> libboost_filesystem.dylib
>> /Library/Application Support/Nuovations/lib/libboost_system.dylib
>>
>> because setting LD_RUNPATH_SEARCH_PATHS for the application (e.g.
>> MyApp)
>> only seems to be supported for 10.5 and I am deploying against 10.4.
>>
>> However, even in that case, I need to tell Xcode "Hey, the libraries
>> you are
>> looking for when running the binary are <here>, not in their installed
>> locations (e.g. /Library/Application Support/Nuovations/lib) just
>> like the
>> five frameworks you resolved."
>
> Typically, you would not install libraries into any place like /
> Library/Application Support/Nuovations/lib. Stuff in Application
> Support should not be critical to the functioning of your app.
>
> <http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/Artic
> les/LibraryDirectory.html>
>
> Rather, the libraries necessary for your app to run should be inside
> the app bundle. Usually, in MyApp.app/Contents/Frameworks.
>
> <http://developer.apple.com/documentation/CoreFOundation/Conceptual/CFBundles/
> BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19
Ken:
Thanks for the prompt reply.
I've done in-bundle frameworks previously for standalone applications or
plug-ins; however, given that the five frameworks and two shared libraries
in question here are leveraged across a preference pane and three
applications, duplicating all those resources in each bundle seemed
inappropriate.
Both Apple's iWork '09 and Adobe appear to have both shared frameworks and
dynamic libraries in Application Support. Those seemed like reasonable
parallels to this circumstance as those are instances of multiple
applications sharing common executable code resources among them.
Is such framework and/or dynamic library sharing typically discouraged?
Regards,
Grant
_______________________________________________
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