Skip to content

add macOS specific instructions#34

Open
miguelmota wants to merge 1 commit intomatja:masterfrom
miguelmota:master
Open

add macOS specific instructions#34
miguelmota wants to merge 1 commit intomatja:masterfrom
miguelmota:master

Conversation

@miguelmota
Copy link
Copy Markdown

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
Copy Markdown

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

@Velua
Copy link
Copy Markdown

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