Re: How to add a library w/o resolving symlinks?
Re: How to add a library w/o resolving symlinks?
- Subject: Re: How to add a library w/o resolving symlinks?
- From: Fritz Anderson <email@hidden>
- Date: Mon, 03 Dec 2012 12:17:48 -0600
On 3 Dec 2012, at 11:34 AM, Jens Alfke <email@hidden> wrote:
> This has annoyed me for years; am I doing this the wrong way?
>
> When I add a dylib to a project, I usually select the unversioned file (e.g. “libfoo.dylib” instead of “libfoo.2.dylib”) because I want Xcode to link with the current version of the library, not a fixed version number. However, since that file is really a symlink to the most recent versioned file, Xcode (or NSOpenPanel) resolves the symlink and actually records the versioned path (“libfoo.2.dylib”) instead.
>
> This isn’t usually much of a problem with system libraries in /usr/lib, but it gets annoying when I use libraries installed via Homebrew. For instance, I just had to deal with a project that broke after I ran ‘brew update', because it was linking against a specific older version of ICU (/usr/local/lib/Cellar/icu4c/41.1/lib/libicuuc.dylib) that was no longer installed, even though I wanted to link against the regular /usr/local/lib/libicuuc.dylib.
>
> As far as I can tell, the only way to get the project to link against the unversioned libraries (i.e. the symlinks) is to hand-edit the pbxproj file in a text editor and fix the paths. Ick. Is there a better way?
If this is the same problem I'm remembering (and if I'm remembering the solution correctly), take the library out of the link build phase, and add it as -lfoo to the other linker flags. There may be search-path dances to do.
I _think_ that bypasses the link map Xcode builds and presents the file directly to the linker.
— F
_______________________________________________
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