Trouble linking libcommonCrypto in iOS 6.1

  • I can add libcommonCrypto.dylib from the iOS Add Frameworks & Libraries UI, but it fails to link with:

    ld: library not found for -lcommonCrypto

    Any idea how I can link this? I need it for CCHmac().

    Thanks!

    --
    Rick
  • Huh. I tried building for device instead, and now I get the following:

    ld: cannot link directly with /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system/libcommonCrypto.dylib.  Link against the umbrella framework 'System.framework' instead. for architecture armv7

    Thing is, there is no System.framework. So I just removed the directly-linked libcrypto, and everything linked.

    On May 5, 2013, at 17:06 , Rick Mann <rmann...> wrote:

    > I can add libcommonCrypto.dylib from the iOS Add Frameworks & Libraries UI, but it fails to link with:
    >
    > ld: library not found for -lcommonCrypto
    >
    >
    > Any idea how I can link this? I need it for CCHmac().
    >
    > Thanks!
    >
    > --
    > Rick

    --
    Rick
  • On May 5, 2013, at 6:06 PM, Rick Mann <rmann...> wrote:

    > I can add libcommonCrypto.dylib from the iOS Add Frameworks & Libraries UI, but it fails to link with:
    >
    > ld: library not found for -lcommonCrypto
    >
    >
    > Any idea how I can link this? I need it for CCHmac().

    What are you trying to accomplish? You normally do not need to link a target directly to libcommonCrypto; it is part of libSystem, the standard C library, and therefore gets automatically linked to the target unless you manually turned that off.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On May 6, 2013, at 10:23 , Nick Zitzmann <nick...> wrote:

    > What are you trying to accomplish? You normally do not need to link a target directly to libcommonCrypto; it is part of libSystem, the standard C library, and therefore gets automatically linked to the target unless you manually turned that off.

    Yeah, I finally figured that out. Thanks.

    An older project had linked against libCrypto, which didn't exist any more, and I was assuming it wasn't linked in by default.

    --
    Rick
  • On May 6, 2013, at 11:37 AM, Rick Mann <rmann...> wrote:

    > An older project had linked against libCrypto, which didn't exist any more, and I was assuming it wasn't linked in by default.

    libcrypto is the cryptography library used by OpenSSL, which has nothing to do with CommonCrypto, is not part of iOS, and is deprecated on OS X (but is still widely used because it has several functions that are currently not available in CommonCrypto or the Security framework).

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On May 6, 2013, at 10:41 , Nick Zitzmann <nick...> wrote:

    >
    > On May 6, 2013, at 11:37 AM, Rick Mann <rmann...> wrote:
    >
    >> An older project had linked against libCrypto, which didn't exist any more, and I was assuming it wasn't linked in by default.
    >
    > libcrypto is the cryptography library used by OpenSSL, which has nothing to do with CommonCrypto, is not part of iOS, and is deprecated on OS X (but is still widely used because it has several functions that are currently not available in CommonCrypto or the Security framework).

    I might have linked against that for base 64 encoding routines in openssl, then, not realizing that CChmac was being provided by the system

    In any case, it's all worked out now.

    --
    Rick
previous month may 2013 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today