openssl/ssl.h not found but installed with homebrew

后端 未结 3 450
误落风尘
误落风尘 2021-01-11 13:57

I am working on a C++ project on my Mac running El Capitan and I get this error even after installing openssl with Homebrew:

g++ -Wall -g -std=c++11 -I../lib         


        
相关标签:
3条回答
  • 2021-01-11 14:04

    I found the solution: clang was not looking in the right place.

    xcode-select --install
    

    This post resolved this issue: On mac, g++ (clang) fails to search /usr/local/include and /usr/local/lib by default

    0 讨论(0)
  • 2021-01-11 14:22

    You can also use an Apple Developer Account to download the standalone option

    https://developer.apple.com/download/more
    

    You'll see something like this:

    0 讨论(0)
  • 2021-01-11 14:27

    Try put these in your bash or zsh profile.

    export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
    export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
    export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
    export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
    
    0 讨论(0)
提交回复
热议问题