samr7 / vanitygen

GNU Affero General Public License v3.0
1.23k stars 629 forks source link

Compilation on Arch Linux fails #106

Open oniony opened 6 years ago

oniony commented 6 years ago

Compilation is failing. It seems from the error message that the type BIGNUM doesn't exist:

cc -ggdb -O3 -Wall   -c -o vanitygen.o vanitygen.c
In file included from vanitygen.c:32:0:
pattern.h:54:12: error: field ‘vxc_bntarg’ has incomplete type
BIGNUM    vxc_bntarg;
          ^~~~~~~~~~
oniony commented 6 years ago

After some investigation it turns out that it's trying to compile against the wrong version of OpenSSL. I fixed the problem by modifying the CFLAGS and LIBS variables to include the OpenSSL 1.0 headers and library:

LIBS=-L/usr/lib/openssl-1.0 -lpcre -lcrypto -lm -lpthread
CFLAGS=-ggdb -O3 -Wall -I/usr/include/openssl-1.0

I've taken the liberty to update the wiki installation page too.

Wikinaut commented 6 years ago

debian 10:

Temporarily install OpenSSL 1.0 headers:

sudo apt-get install libssl1.0-dev -y

and change in Makefile the first two lines to

LIBS=-L/usr/lib/openssl-1.0 -lpcre -lcrypto -lm -lpthread
CFLAGS=-ggdb -O3 -Wall -I/usr/include/openssl-1.0

Run make. After compilation, it may be a good practice to re-install the correct openssl:

sudo apt-get install libssl-dev -y