2017-07-21 11 views
0

私はMacでCLion(CMake)でopensslを実行したいと思っています。macOS-Sierraでopensslを使用できません

自作

brew install openssl 

とOpenSSLをインストールしかし、まだCLionは、OpenSSLを見つけることができません。過去には使用可能でした

brew link openssl 

しかし、今日は自作では拒否されているようです。

Warning: Refusing to link: openssl 
Linking keg-only openssl means you may end up linking against the insecure, 
deprecated system OpenSSL while using the headers from Homebrew's openssl. 
Instead, pass the full include/library paths to your compiler e.g.: 
    -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib 

は、それから私はCLionで、次のcmakeのオプション(CMakeLists.txt)

set(I "/usr/local/opt/openssl/include") 
set(L "/usr/local/opt/openssl/lib") 
include_directories(${I}) 

を使用しかし、まだ私が手:私はこのテーマ別に見つけることができる

Undefined symbols for architecture x86_64: 
    "_EVP_DigestSignFinal", referenced from: 
Undefined symbols for architecture x86_64: 
    "_EVP_DigestSignFinal", referenced from: 
     OpenSSL::signMsg(Buffer, Buffer, SignOptions) in libMyLib.a(ssl_state.cpp.o) 
     OpenSSL::signMsg(Buffer, Buffer, SignOptions) in libMyLib.a(ssl_state.cpp.o) 

ほぼすべてを約年上でしたMacOSのバージョンですが、Appleはopenssl 0.9.8から開発ヘッダーを削除しています。多くのガイドはもう動作しません。

+1

も参照してください[OpenSSLをリンクするための自作拒否](http://stackoverflow.com/q/38670295)、[自作とOS XのアップデートにOpenSSL](のhttp:/を/stackoverflow.com/q/15185661)、[最新バージョンのopenssl Mac OS X El Capitanのインストール方法](http://stackoverflow.com/q/35129977)、[OS XでのOpenSSLのアップグレード方法](http ://apple.stackexchange.com/q/126830)、[HomeBrewを使用したOpensslインストールが失敗する](http://superuser.com/q/486389)など – jww

答えて

0

これはリンクに問題があるようです。私はHomebrewの代わりにMacportを使用していますが、MacOS Sierraでも使用しています。

私はあなたのコードを見ることができない、あなたは最小限の作業例を提供しなかったので、私が使用:、https://github.com/Andersbakken/openssl-examples.gitあなたと同様に

を私はCMakeLists.txt

set(I "/opt/local/include") 
set(L "/opt/local/lib") 
include_directories(${I}) 

に以下の行を追加し、

cmake . 
make 

実際に必要なファイルがパスの下で利用可能であることを確認しましたか??

あなたが試してみました:

brew info openssl 
関連する問題