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
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
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:
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"