OSX Catalina: ld: library not found for -lssl SOLUTION

The error

When you try to compile something that uses ssl, you get the error:

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The solution

You need to follow two simple steps to fix the ssl library not found error:

  1. brew install openssl
  2. export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/