'install openssl-devel on Mac

I need to install the openssl-devel on Mac. But I've tried brew and macport both. Neither of them work.

And I have also googled this problem--- install openssl-devel on Mac. But, I did not find an exact answer.

Anyone met this kind of problem before?



Solution 1:[1]

this command solve my problem:

brew install [email protected]
cp /usr/local/opt/[email protected]/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/

Solution 2:[2]

This has changed with the latest verison of brew on Big Sur (11.5.1) on a Macbook M1 (just for completeness):

export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"

Solution 3:[3]

I suppose you want to compile C++ program, and the C++ code include openssl headers, so just install openssl with brew:

brew install openssl

or install openssl 1.1.1 with

brew install [email protected]

Then you can find include and lib folder in /usr/local/opt/[email protected]/ or /usr/local/opt/[email protected], and adjust your makefile, modify the path like this:

OPENSSL_DIR = /usr/local/opt/[email protected]
OPENSSL_SUPPORT = -I$(OPENSSL_DIR)/include -L$(OPENSSL_DIR)/lib

Solution 4:[4]

brew install [email protected]

cd /usr/local/lib/pkgconfig/

make symbolic links instead of copying

cp --symbolic-link /usr/local/opt/[email protected]/lib/pkgconfig/* .

Symlinks are now in the present working directory.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andy Tao
Solution 2 MuseumPiece
Solution 3 McGrady
Solution 4 Michael