Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: 'openssl/bio.h' file not found

I am trying to install Apache Thrift on my Mac, but am hitting an issue. I followed the installation steps on this page, but when I try to do the steps for installing libevent, I get the following error when running the make command:

fatal error because of 'openssl/bio.h' file not found

Screenshot of actual error

I've checked the version of openSSL I'm using, and it's "0.9.8zg"

Any advice on what I should do to fix this?

like image 504
Lewis-Eric Avatar asked Oct 16 '15 07:10

Lewis-Eric


4 Answers

I'm on El Capitan 10.11.6 and i had the issue while installing manually the mongodb php extension.

I solved it following the indications of @user7059092 about the configure stage :

$./configure LDFLAGS='-L/usr/local/opt/openssl/lib' CPPFLAGS='-I/usr/local/opt/openssl/include'

like image 54
Simon Baudry Avatar answered Nov 11 '22 21:11

Simon Baudry


I've the same problem while installing Thrift like others. In my case I solve following the next Jira:

https://jira.mongodb.org/browse/CDRIVER-941

Another approach is, after "brew install openssl", to do "brew link openssl --force", which installs headers to /usr/local/include/openssl.

$ brew install openssl 
$ brew link openssl --force

For some reason, Homebrew's own pkg-config knows that OpenSSL is homebrewed only once you run "link openssl --force":

$ pkg-config --variable=includedir openssl

/usr/local/Cellar/openssl/1.0.2d_1/include

like image 35
Franzi Avatar answered Nov 11 '22 21:11

Franzi


I was also running into this problem when installing apache Thrift and here is how I solved it for my system setup.

My operating system is El Capitan (10.11.1) with all the latest updates installed and I used MacPorts to install openssl (version 1.0.2e 3 Dec 2015). This installed openssl in /opt/local. In any case, try to find bio.h (for my case was located at /opt/local/include/openssl/bio.h) and you can probably tell where openssl is installed for your setup. When you are in the libevent folder and run:

./configure --help

you will see that

--includedir=DIR        C header files [PREFIX/include]

Since PREFIX is /usr/local as per instructions, I just had to create a symlink in /usr/local/include.

cd /usr/local/include
sudo ln -s /opt/local/include/openssl/ openssl

Now make executes without errors.

like image 6
Bart Joosten Avatar answered Nov 11 '22 21:11

Bart Joosten


Are you on El Capitan? That appeared to be my issue.

Jeremy's answer on this Puma issue worked for me:

https://github.com/puma/puma/issues/718

My issue was related to Puma gem specifically, but your issue might be similar if on El Capitan.

like image 3
jakeatwork Avatar answered Nov 11 '22 21:11

jakeatwork