2

I have compiled OpenSSL and have the two files: libcrypto.a and libssl.a.

In my source file I use:

#include <openssl/pkcs7.h>
#include <openssl/objects.h>
#include <openssl/sha.h>
#include <openssl/x509.h>
#include <openssl/err.h>

Then in my project under "Header Search Paths" I add:

"$(PROJECT_DIR)/Shared/libraries/openssl/include"

I add the same thing to "User Header Search Paths"

The two .a library files are linked.

When I compile, Xcode is not using my OpenSSL header files, rather it is pulling them from the standard SDK rather than my custom build:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/openssl/pkcs7.h

How can I force it to use my header files?

$(PROJECT_DIR)/Shared/libraries/openssl/include/openssl/pkcs7.h

"Always Search User Paths" is set to "Yes"

jww
  • 97,681
  • 90
  • 411
  • 885
Trygve
  • 1,317
  • 10
  • 27
  • Possible duplicate of [How to set include path in xcode project](http://stackoverflow.com/questions/14134064/how-to-set-include-path-in-xcode-project) – jww Apr 27 '15 at 06:23
  • @jww That's not the right duplicate as the accepted answer is to use *Other C Flags*, which cannot be right. – trojanfoe Apr 27 '15 at 06:50
  • @trojanfoe - OK, thanks. Perhaps you should add the right answer to the duplicate question. Or provide a better duplicate since this appears to be a frequent question. – jww Apr 27 '15 at 06:53
  • OP: Have you examined the compiler line in the build log to check that the correct include paths are being used? Setting *Header Search Paths* is the correct thing to do. – trojanfoe Apr 27 '15 at 06:57
  • I guess this is no longer a problem? For people hitting OpenSSL header problems with XCode, I found a solution here: https://stackoverflow.com/questions/23955003/how-to-include-openssl-on-an-ios-project-in-a-way-that-works/64039858#64039858 – rustyMagnet Sep 24 '20 at 13:31

0 Answers0