Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add macOS specific instructions #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miguelmota
Copy link

I was running into an openssl lib path issue when installing on macOS:

$ make
cc -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long    -c -o main.o main.c
main.c:11:10: fatal error: 'openssl/err.h' file not found
#include <openssl/err.h>
         ^~~~~~~~~~~~~~~
1 error generated.
make: *** [main.o] Error 1

then stumbled across this answer that mentions you have to export flags for specifying openssl lib paths:

export LDFLAGS="-L/usr/local/opt/openssl/lib -L/usr/local/lib -L/usr/local/opt/expat/lib"
export CFLAGS="-I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include"
export CPPFLAGS="-I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include"

and now make works:

$ make
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o main.o main.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o keys.o keys.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o hash.o hash.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o base58.o base58.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o result.o result.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o combination.o combination.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o applog.o applog.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o utility.o utility.c
cc -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -D OS_UNIX -ansi -Wall  -O2 -Wno-long-long  -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include  -c -o prefix.o prefix.c
cc -o bitcoin-tool main.o keys.o hash.o base58.o result.o combination.o applog.o utility.o prefix.o -L /usr/lib -lcrypto -lssl

@streamofstars
Copy link

In my case it was not enough, I had to also do:
export LIBRARY_PATH="/usr/local/opt/openssl/lib"

@Velua
Copy link

Velua commented Aug 1, 2023

Legend! Thanks this was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants