Well I verified that the dylib and a files were for OpenSSL 1.0.1c by searching for the version in the files. Indeed I had libcrypto and libssl files for 1.0.1c. So I tried adding them to Xcode. First I ensured the -lssl and -lcrypto flags were removed and I tried the dylibs first. This is what I got:
warning: Unable to read symbols for /usr/local/ssl/lib/libcrypto.1.0.0.dylib (file not found).
warning: Unable to read symbols from "libcrypto.1.0.0.dylib" (not yet mapped into memory).
warning: Unable to read symbols for /usr/local/ssl/lib/libssl.1.0.0.dylib (file not found).
warning: Unable to read symbols from "libssl.1.0.0.dylib" (not yet mapped into memory).
[Switching to process 1266 thread 0x0]
dyld: Library not loaded: /usr/local/ssl/lib/libcrypto.1.0.0.dylib
Referenced from: /Users/matt/Library/Developer/Xcode/DerivedData/cbitcoin-bdkcvvuopgevvwcciljkluzxqser/Build/Products/Debug/testKeyHash
Reason: image not found
I found this odd. Surely the dynamic libraries can be loaded from any directory?
Well I tried moving them to /usr/local/ssl/lib/ and I get this:
OpenSSL version: OpenSSL 0.9.8r 8 Feb 2011
Erm... So a 1.0.1c dylib that gives the version 0.9.8r? Clearly something is corrupted. I get similar problems with the static libraries. "0.9.8r" is not anywhere in the library files but "1.0.1c" is. Does anyone know what on earth is going on?