curl-library
Re: Adding static libcurl.a to xcode 7.2 example project adds libcurl.4.dylib dependency
From: Stephen Greenfield <StephenG_at_screenplay.com>
Date: Tue, 23 Feb 2016 00:32:59 +0000
Date: Tue, 23 Feb 2016 00:32:59 +0000
Daniel,
We have figured it out — but it kinda sucks from an Xcode environment
perspective….
Indeed, Xcode's generated link command of -lcurl is telling the linker to,
by default, link with a DYNAMIC library. The linker will NOT accept
-static as a prefix to -l, because the CLANG driver doesn't support
turning on/off -static/-dynamic (if the linker does see -static, it
expects that EVERYTHING is static — Apple STRONGLY DISCOURAGES THIS).
Once we changed the -lcurl to explicitly "/usr/local/lib/libcurl.a", the
linked .app no longer showed a dependency on libcurl.4.dylib.
What sucks is that it appears there is no easy method to do this through
Xcode — unless I make a copy of libcurl.a with a DIFFERENT NAME.
Stephen
-- On 2/22/16, 3:42 PM, "curl-library on behalf of Daniel Stenberg" <curl-library-bounces_at_cool.haxx.se on behalf of daniel_at_haxx.se> wrote: >On Mon, 22 Feb 2016, Stephen Greenfield wrote: > >> /usr/local/lib has permissions for System = Read & Write, wheel = >> Read only, and Everyone = Read only. > >Yes, that's why 'make install' needs sudo, not the other make commands. > >> This is Xcode's link command line from the copy of Apple's >> "ViewController.app" OS X Cocoa example, which I added libcurl.a to: > >Wow, that's massive and I know far too little Mac OS X stuff to comment >on all >that. But you're linking with -l and just adding the dir where the new >libcurl >is installed with -L. Is that really preventing the linker from finding >the >shared default libcurl version you already have installed? I would guess >it >doesn't and that is what happens. > >-- > > / daniel.haxx.se >------------------------------------------------------------------- >List admin: https://cool.haxx.se/list/listinfo/curl-library >Etiquette: https://curl.haxx.se/mail/etiquette.html ------------------------------------------------------------------- List admin: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2016-02-23