File 'openssl / conf.h' not found on macOS Sierra

I am working on a C ++ project that uses boost asio. While trying to build libraries using Asia I get the following error:

/usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19:10: fatal error: 'openssl/conf.h' file not found
#include <openssl/conf.h>

      

Searching for solutions here and here , I tried

brew install openssl
brew link openssl --force
xcode-select --install

      

But it didn't help.

Doing the following also doesn't work

export C_INCLUDE_PATH=/usr/local/include
export CPLUS_INCLUDE_PATH=/usr/local/include

      

The Boost version I'm using is boost_1_63_0

. I am on MacOS Sierra

with Xcode 8.3.1

. I have installed boost using Homebrew

brew install boost

      

As I understand from other links, Xcode is looking for the wrong place for ssl headers. But how can I solve this?

I looked over my /usr/local/include

and /opt/local/include

. 'openssl / ssl.h' is missing in both locations. But the execution brew install openssl

says the following

Warning: openssl is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version

      

Performing brew install openssl --force

says

Warning: openssl-1.0.2k already installed, it just not linked.

      

Execution brew link openssl --force

also doesn't solve the problem.

Doig a which openssl

returns the following:

/usr/local/bin/openssl

      

Please suggest

+3


source to share


1 answer


Bundled or not, all installed Homebrew packages are available here /usr/local/opt

. Also, when installing openssl

via Homebrew, Homebrew tells you how to use the openssl libraries and headers.

~ nega@rust 15s
❯ brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2k.el_capitan.bottle.tar.gz
Already downloaded: /Users/nega/Library/Caches/Homebrew/openssl-1.0.2k.el_capitan.bottle.tar.gz
==> Pouring openssl-1.0.2k.el_capitan.bottle.tar.gz
==> Using the sandbox
==> 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 was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2k: 1,696 files, 12MB

~ nega@rust 11s

      



You don't need anything brew link

. Just use the Homebrew directories that you mention in the appropriate places in Xcode and CMake.

+4


source







All Articles