Reputation: 9791
I write a C program with Xcode 4. I include some OpenSSL header files:
#include <openssl/sha.h>
#include <openssl/hmac.h>
#include <openssl/evp.h>
This does not seem to work, as I get Apple Mach-O Linker (ld) Error: "..." referenced from:
errors.
I have tried to include the OpenSSL framework, but I cannot find it in the list (I only find libssl
which doesn't do the trick). What am I doing wrong?
Upvotes: 2
Views: 1190
Reputation:
#include
is relevant at the preprocessing/compiling phase. Since you’re getting linker errors, the problem is that you haven’t linked the appropriate libraries.
OpenSSL is not a framework in the Apple sense, which is why you haven’t found it. In your case, since libssl wasn't enough, you’re missing libcrypto (which is also part of OpenSSL).
Upvotes: 3