Catalina sucks. macOS sucks. It updates and updates and makes things obselete almost everyday. Yet we love it and we use it. So here we are, trying to figure out the mysterious disappearance of -lssl
!
If you are still using Mojave or something, the solution is straightforward. Just
xcode-select --install
And you are done!
Of course, you need to have Xcode
installed first. Or do you? Just joking! Haha! xcode-select
doesn’t require xcode
installed. macOS is that fun.
I was wrong. The macOS
openssl
is still here after all. Please check the ERRATA! section below.
With this great update, the openssl
library as we know seems to be gone forever from the default Xcode toolkit. But that’s OK! We will just get it from brew
. You must’ve installed that, right? Otherwise, you can get it from here.
After that, you could just
brew install openssl
And after that’s done,
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/Cellar/openssl/1.0.2t/lib
The directory above might vary. I am just pointing it to the newest version in the time of the writing. But after this, you could continue to build your project! Have fun!
Of course, this is a temporary solution. There might be a more permanent solution such as creating a symbolic link & add the export
statement into your .bashrc
or .zshrc
, however they might not be very elegant. But at least the library now works as we know it, right?
So I was wrong; I didn’t do too much research. Sorry. macOS still gets its openssl
library, and it is right here: /usr/local/opt/openssl.
So instead of
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/Cellar/openssl/1.0.2t/lib
you can just:
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl