iOS   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了xcode – MacOS Sierra上找不到’openssl / conf.h’文件错误大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我正在开发一个使用boost asio的C项目.尝试构建使用亚洲的库,我收到以下错误 /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19:10: fatal error: 'openssl/conf.h' file not found #include <openssl/conf.h> 寻找解决方案here& here,我试
我正在开发一个使用boost asio的C项目.尝试构建使用亚洲的库,我收到以下错误

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

寻找解决方here& @L_772_5@,我试过了

brew install openssl
brew link openssl --force
xcode-SELEct --install

但没有帮助.

执行以下操作似乎也不起作用

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

我正在使用的Boost版本是boost_1_63_0.我在Mac OS Sierra上使用Xcode 8.3.1.我使用Homebrew安装了boost

brew install boost

据我所知,从其他链接来看,Xcode正在寻找ssl头的错误位置.@H_673_41@但是我怎么解决这个问题呢?

我查看了我的/usr/local/include& /选择/本地/包括.两个地方都没有’openssl / ssl.h’.但是做一个brew安装openssl说如下

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

一个brew安装openssl –force说

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

使用brew链接openssl –force也无法解决问题.

Doig a openssl返回以下内容

/usr/local/bin/openssl

请建议

解决方法

是否链接,可以通过/usr/local/opt中的链接访问所有已安装的Homebrew软件包.此外,当您通过Homebrew安装openssl时,Homebrew会告诉您如何使用openssl库和标头.

~ 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

大佬总结

以上是大佬教程为你收集整理的xcode – MacOS Sierra上找不到’openssl / conf.h’文件错误全部内容,希望文章能够帮你解决xcode – MacOS Sierra上找不到’openssl / conf.h’文件错误所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。