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) if(typeof __ez_fad_position != 'undefined'){__ez_fad_position('div-gpt-ad-tutorials_technology-medrectangle-3-0')}; 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/