I’m trying to use standard system header files in my C++ XCode project:
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
The build fails and it complains:
"Openssl/bio.h: No such file or directory"
I added /usr/include to the “Header Search Paths” in Project settings, but that doesn’t fix it.
I can fix it by adding the whole path like:
#include </usr/include/openssl/bio.h>
— but the project is full of similar includes and I don’t want to change all of them this way. Also, I feel I shouldn’t have to do this.
Another way to fix it would be as another thread mentioned, which is to add /usr/include to User Header Search Paths. But if I do that, then I’d have to change all the angle brackets <> to quotes “”, which again seems like a hack. I mean, these are standard system header files so I feel it should be something simple, not requiring these kinds of hacks.
Any ideas?
Thanks!
Xcode uses the currently selected SDK as a base path, which it prefixes on to system includes. So if your SDK is
/Developer/SDKs/MacOSX10.6.sdkthen it will look under/Developer/SDKs/MacOSX10.6.sdk/usr/includeby default for system includes.There are various possible workarounds – I would probably just put a symbolic link in
/Developer/SDKs/MacOSX10.6.sdk/usr/includepointing at/usr/include/opensslbut you can probably think of others now that you know the underlying problem.