Compile libevent (source file in/users/carl/downloads/libevent-2.1.8-stable), execute make command, report
Install libevent bufferevent_openssl.c:60:10:fatal Error: ' openssl/bio.h ' file
The first reaction, the feeling is not OpenSSL version too low.
1. View the OpenSSL version, found that the version is relatively low
$ OpenSSL version
OpenSSL 0.9.8zh 2016
2. Upgrade Spenssl, execute
Brew Install OpenSSL
The output (ignored by the previous output) is as follows:
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2l.sierra.bottle.tar.gz
######################################################################## 100%
==> Pouring openssl-1.0.2l.sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the Systemroots
Keychain. To add additional certificates (e.g. the certificates added in
The System keychain), place. Pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it's not symlinked into/usr/local,
Because Apple has deprecated use the OpenSSL in favor of it own TLS and crypto libraries.
If you are need to have this software the in your PATH run:
Echo ' Export path= "/usr/local/opt/openssl/bin: $PATH" ' >> ~/.ZSHRC
For compilers to find this software your may need to set:
Ldflags:-l/usr/local/opt/openssl/lib
Cppflags:-i/usr/local/opt/openssl/include
==> Summary
/usr/local/cellar/openssl/1.0.2l:1,709 files, 12.2MB
Output above information to indicate successful installation, installation directory in (/USR/LOCAL/CELLAR/OPENSSL/1.0.2L)
3. Configure the OpenSSL environment variable to point to the newly installed OpenSSL
A. Implementation of Whereis OpenSSL
Output/usr/bin/openssl
B. Back up the original OpenSSL, perform mv/usr/bin/openssl/usr/bin/openssl_old
C. Create OpenSSL command soft connection, execute Ln-s/usr/local/cellar/openssl/1.0.2l/bin/openssl/usr/bin/openssl
D. Re-implementation of OpenSSL version
Output OpenSSL 1.0.2l 2017
Indicates that the upgrade was successful.
After the OpenSSL upgrade succeeds, recompile the libevent, execute the Make name, or report install libevent bufferevent_openssl.c:60:10:fatal error: ' Openssl/bio.h ' File Error,
The next header file in the newly installed OpenSSL directory is then copied to the Libevent source file directory.
Perform Cp-r/usr/local/cellar/openssl/1.0.2l/bin/openssl/include/users/carl/downloads/libevent-2.1.8-stable
Re-make, compile successfully.
Resources:
http://blog.csdn.net/hackcoder/article/details/52442350
http://blog.csdn.net/pz0605/article/details/51954868