Skip to content

Instantly share code, notes, and snippets.

@aklap
Created October 17, 2016 04:25
Resolving missing link to libcrypto/openssl on OSX
@elfgoh
Copy link

elfgoh commented Aug 29, 2022

this command solve my problem on github CI job: cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/

On M1 seems like I can make to with $ ln -s /opt/homebrew/opt/openssl\@1.1/lib/pkgconfig/libcrypto.pc /usr/local/lib/pkgconfig/libcrypto.pc

Copy link

ghost commented Oct 24, 2022

@elfgoh thanks, this worked for me!

@EhsanZ
Copy link

EhsanZ commented Nov 5, 2023

In M1 chip computers, the installations are placed in /opt/homebrew/opt instead of /usr/local/opt. So we should use the following:

export LDFLAGS="-L/opt/homebrew/opt/curl/lib -L/opt/homebrew/opt/openssl/lib"
export CPPFLAGS="-I/opt/homebrew/opt/curl/include -I/user/local/opt/openssl/include"

Thank you very much 🙏

@BrianODell
Copy link

for what it's worth, I got through a compile (v2.48) with:

./configure LDFLAGS=-L/opt/homebrew/lib/ CFLAGS="-I/opt/homebrew/include"

on my M1 mac. Zero symlinks or copying of files!

@joelparkerhenderson
Copy link

In case anyone here is trying this on macOS with brew and the toolmise or `asdf , this is what worked for me:

brew install gcc readline zlib curl openssl@1.1 ossp-uuid icu4c pkg-config
PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig" \
LDFLAGS="-L$(brew --prefix)/lib" \
CPPFLAGS="-I$(brew --prefix)/include" \
mise use postgres@17 --verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment