Fix for Xcode 7 and OF 0.8.4 (opensslconf.h not found)


#1

When building an OF 0.8.4 project with Xcode 7, you may see the following error:

'openssl/opensslconf.h' file not found

To fix this, open the file CoreOF.xcconfig in libs/openFrameworksCompiled/project/osx/ and add the following line at the bottom:

USER_HEADER_SEARCH_PATHS = "$(OF_PATH)/libs/openssl/include"

If you understand the .xcconfig format, a cleaner fix would be to define a HEADER_OPENSSL variable at the top of the file, and add it to the OF_CORE_HEADERS list. The above fix should work fine, though.

EDIT: an earlier version of this post involved installing openssl with homebrew, which is not necessary.


Xcode 7 + Project Generator
Warning : before upgrading to Xcode 7
Macam ps3eye Mountain Lion
Warning : before upgrading to Xcode 7
Warning : before upgrading to Xcode 7
#2

openssl is inside the libs folder of OF, both includes and the binary libs so there shouldn’t be any need to install it in the system. not sure why xcode is not finding it though


#3

Ah, I missed that thanks @arturo. It looks like openssl wasn’t included in the header list in 0.8.4 though, maybe it’s been using an SDK provided openssl the whole time? As in, there’s no HEADER_OPENSSL variable.

I’ll edit the instructions above to use the OF-provided openssl

If I add one, oddly, it errors out on GL/glew.h not found afterwards. (it works fine, Xcode was being weird)


#4

Thanks!!! My problem was solved!


#5

#6

My understanding is that OS X 10.11 (El Capitan) no longer uses openssl. Hence, the default libs aren’t where Xcode used to find them on the system.


#7

I think the issue comes from an oversight in OF 0.8.4, where OF provided its own copy of the openssl library but didn’t add the headers to the search path. It happened to work anyway since the pre 10.11 SDKs added their own copy of the openssl headers to the search path, but it should use the ones provided by OF in libs/openssl


#8

This worked for me: defining a variable HEADER_OPENSSL in CoreOF.xcconfig

HEADER_OPENSSL = "$(OF_PATH)/libs/openssl/include"

and then adding $(HEADER_OPENSSL) to the OF_CORE_HEADERS as below:

OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_POCO) $(HEADER_FREETYPE) $(HEADER_FREETYPE2) $(HEADER_FMODEX) $(HEADER_GLEW) $(HEADER_FREEIMAGE) $(HEADER_TESS2) $(HEADER_CAIRO) $(HEADER_RTAUDIO) $(HEADER_GLFW) $(HEADER_OPENSSL)

#9

This solution was working for me until today, but now I’m getting that same issue. I have auto-updates turned on and it looks like it updated to XCode 7.0.1 last night… Any suggestions?

EDIT #1: This older solution worked for me again: Warning : before upgrading to Xcode 7

EDIT #2: This just happened on my second computer as well.


#10

@dennyroberts that sounds pretty strange, considering the fix should be relevant for all versions of Xcode. Are you maybe overriding the openssl path, and are you sure it’s right in the first place? It sounds more like there’s another issue at play here.


#11

This solved my compile problem on xcode7. Thanks!


#12

Thank you, that worked for me too with XCode 7.0.1 and 10.11


#13

I tried @ruohoruotsi’s solution and it worked for me! Thanks! :smiley:


#14

Works for me! Thanks a lot!


#15

Thank you thank you thank you! You rock!


#16

i done a quick video on this for my openframeworks tutorial series. obviously thanking @admsyn :wink:


#17

It’s certainly possible something else is going on. Since it happened on two computers, I sort of doubt it’s anything I’d done tinkering around (my laptop is relatively clean / tinker free), and I wouldn’t know how to override the ssl path anyway. I definitely did the steps outlined in your first post correctly, copied and pasted that line exactly… And that worked just fine until the update (though the timing could be a coincidence?)

The only thing I can think of is that I use a couple of pretty outdated addons, namely ofxTwitter and ofxHttpUtils, and I’m pretty sure they both use openssl. The latter especially has given me other issues in the past. Could this have anything to do with it?


#18

Ha, nice fix!


#19

Nice!

I used this fix

USER_HEADER_SEARCH_PATHS = "$(OF_PATH)/libs/openssl/include"

but when I include ofxHTTP in my project the issue with openssl appeared again:

/Users/apple/Documents/dev/develop/of_v0.8.4_osx_release/addons/ofxHTTP/libs/ofxHTTP/src/DefaultRedirectProcessor.cpp:49:10: 'openssl/ssl.h' file not found

Any help?

Using XCode 7.1
Yosemite
I tried ofxHTTP master and develop

It’s being frustrating because, is so simple to use this addon.

EDIT:
‘/Users/apple/Documents/dev/develop/of_v0.8.4_osx_release/libs/poco/include/Poco/Crypto/X509Certificate.h:49:10: ‘openssl/ssl.h’ file not found’


#20

It should be a similar fix, but applied to your ofApp’s build settings instead of the openFrameworks build settings.

You can do the edit in Project.xcconfig, which will be in your ofApp’s folder. Or, select your app’s project in the navigator (sidebar on the left), go to build settings > user header search paths and add in "$(OF_PATH)/libs/openssl/include"