cURL / Mailing Lists / curl-library / Single Mail


Re: Adding static libcurl.a to xcode 7.2 example project adds libcurl.4.dylib dependency

From: Stephen Greenfield <>
Date: Mon, 22 Feb 2016 23:01:28 +0000

On 2/22/16, 1:47 PM, "curl-library on behalf of Daniel Stenberg"
< on behalf of> wrote:


Thanks for your help here.

>If you need sudo to run those commands, you did something wrong already
>that point. Like extracted the tarball as root or you did a previous
>build as

     /usr/local/lib has permissions for System = Read & Write, wheel =
Read only, and Everyone = Read only. Since I'm building from curl-7.47.1
which is in my own user, stephen, I'm guessing that's why. I'm an admin,

>But I also note that you didn't run just plain 'make' there?

OK, right you are. I've done all this from scratch:

     sudo make clean
     ./configure --disable-share --with-darwinssl
     sudo make
     sudo make install

>And after you've ran 'make', you find a libcurl.a in the lib/.libs/ dir,

Yes — these three libcurl.* files in that location:

     -rw-r--r-- 1 root staff 572920 Feb 22 14:13 lib/.libs/libcurl.a
     lrwxr-xr-x 1 root staff 13 Feb 22 14:13 lib/.libs/
-> ../
     -rw-r--r-- 1 root staff 964 Feb 22 14:13 lib/.libs/libcurl.lai

> libcurl.a provides all the same symbols that libcurl.4.dylib does. If
>you end
> up using libcurl.4.dylib anyway, it is probably because you use the
>wrong link
> command.

This is Xcode's link command line from the copy of Apple's
"" OS X Cocoa example, which I added libcurl.a to:

roller normal x86_64
     cd "/Users/stephen/dev/Cocoa/Cocoa UI Examples/ViewController"
ain/usr/bin/clang -arch x86_64 -isysroot
per/SDKs/MacOSX10.11.sdk -L/Users/stephen/dev/Cocoa/Cocoa\ UI\
Examples/ViewController/DerivedData/Build/Products/Debug -L/usr/local/lib
-F/Users/stephen/dev/Cocoa/Cocoa\ UI\
Examples/ViewController/DerivedData/Build/Products/Debug -filelist
/Users/stephen/dev/Cocoa/Cocoa\ UI\
ist -mmacosx-version-min=10.8 -fobjc-link-runtime -lcurl -framework
CoreMedia -framework AVFoundation -framework AppKit -framework Quartz
-Xlinker -dependency_info -Xlinker /Users/stephen/dev/Cocoa/Cocoa\ UI\
y_info.dat -o /Users/stephen/dev/Cocoa/Cocoa\ UI\

Then immediately after building and running, I've used otool:

     otool -L

               /usr/local/lib/libcurl.4.dylib (compatibility version
9.0.0, current version 9.0.0)
(compatibility version 1.0.0, current version 1.0.0)
(compatibility version 1.0.0, current version 2.0.0)
(compatibility version 45.0.0, current version 1404.32.0)
(compatibility version 1.0.0, current version 1.0.0)
(compatibility version 300.0.0, current version 1256.1.0)
               /usr/lib/libobjc.A.dylib (compatibility version 1.0.0,
current version 228.0.0)
               /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 1226.10.1)
on (compatibility version 150.0.0, current version 1256.14.0)


List admin:
Received on 2016-02-23